Font caching (was Re: UI for SDL)

hayward at slothmud.org wrote:

You might try doing glyph caching yourself; don’t think it’d be too hard
to do. Use SDL_ttf to render all of the characters in a font in an
offscreen surface and then do all your blitting from there. But then
again, you’re going to have to learn some important information about
the font that you’ve just cached if you’re going to do this right (such
as kerning information and so forth), but the freetype API provides
this, AFAIK.

This is the same as using a bitmapped font…
:slight_smile:

Exactly. You get all the advantages, but at the cost of increased
memory usage. Memory usage can become excessive when you’re rendering
an antialiased font at a very high point size, but you’re probably going
to use it only to render for small point sizes if it’s to be used in the
context of a GUI toolkit.–

| Rafael R. Sevilla @Rafael_R_Sevilla |
| Instrumentation, Robotics, and Control Laboratory |

College of Engineering, University of the Philippines, Diliman