Author Topic: Displaying text in SDL  (Read 1800 times)

clach04 (OP)

  • Posts: 256
Displaying text in SDL
« on: February 02, 2011, 05:25:36 am »
Poligrafowicz kicked off a mini discussion on IRC on how text can be displayed in SDL. There are way too many options to discuss but the big options are:

SFont a bitmap based font renderer - (source code available at - SFont is ideal for ASCII only. It can also be used for latin1 (e.g. or other single byte character sets. gmenu2x uses a modified version of SFont that can display Latin1, see bottom of page There is a fork that claims to handle Unicode too, if that is needed (I've not used the Unicode fork). There are tools that can convert TTF into bitmaps in the contrib directory).

The other option is SDL_ttf, this can support Unicode. One issue is that Unicode fonts can be MASSIVE, e.g. 20Mb to support the common languages such as; Japanese, Chinese, English, Spainish/French/German, Russian, Polish, etc.
The goomba menu system uses this and

I've used both, I've a slight preference for SFont.

If you want other examples of SFont usage see the native SDk demo; or OhBoy. OhBoy has build options for libTTF (not SDL_ttf) or SFont.

Disclaimer; I have commit access to SFont so I may be biased  ;).

[edit goomba link corrected]
« Last Edit: February 02, 2011, 05:30:17 am by clach04 »


Post a new topic
Post a new topic