Skip to main content
gamedev.net
🔒 Locked

Font Manager?

Started by Brice Lambson 1 reply 700+ views
Original Post
Brice Lambson
Brice Lambson
Salutations to everyone, I didn't know where to post this topic because there are a few issues at hand. Let me give you the background... I'm working on my first engine, and it's comming along verrry nicely, but anyway, I'm currently coding my Font manager -- a class to handle the loading/caching of fonts. My engine is SDL-based, so I decided to use SDL_ttf; however, the TTF_Font structure has to store a new instance for each font, size, and face combination. So obviously, the more flexibility I give to my engine, the more ram it's going to use. My questions are: 1. Are there any other good font libraries for SDL that are a little more general in storing loaded fonts? 2. What are some ways I can/should cut back on ram? (e.g. Only provide users with 3 font sizes (small, medium, and large), garbage collect unused fonts, etc.)
--Brice Lambson
Telastyn
Telastyn
Do the created fonts really take up that much space?

Eh, either way, having reference counted resources [including fonts] is pretty standard, and should help a bit with keeping the footprint down.
rip-off
rip-off
doing the nearly the same thing last night.

as a stop gap solution i have a few common sized fonts hanging around(statically allocated) and a TTF_Font * thats stores the most recently used non - standard size.




really depends on your fonting needs - my needs are basic...

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.