[SDL] sdl_ttf font sizes

Clemens Kirchgatterer clemens at thf.ath.cx
Mon Jul 29 18:33:00 PDT 2002


Chris Thielen <chris at luethy.net> wrote:

> > You can always open it _multiple_ times at different sizes, if I
> > understand SDL_ttf correctly.  (Honestly, I've barely used it so
> > far...)
> 
> Well, I'll be switching the sizes back and forth. I'll be needing the
> old size again, so, is there a methodology in SDL_ttf to do that or
> ... what? Should I reinit the font?

i have once used the following concept.

whenever i needed a font, i generetaed a key from fontname and size
(like "fixed.ttf,16") and kept a list of key/fonthandle pairs. if the
key was allready in the list use the handle, otherwise open the font and
store the key and its handle in the list.

maybe this helps ...
clemens




More information about the SDL mailing list