[SDL] The PolyFonts library
bob at pendleton.com
Sun Jul 20 14:57:00 PDT 2003
One of the more common complaints that I have heard on the SDL list over
the last few years is that there is no built in support for text. That
there is no simple way to draw debugging text over an SDL window. People
have mentioned the text support in libraries like GLUT and list of
others... And, of course there is the problem of finding truly free
fonts for use with SDL applications.
I ran into the same problems myself and the result is the PolyFonts
I have collected the few truly free fonts I have found and converted
them into geometric data that you can compile directly into your
programs. No need to deal with the hassle of loading font files or the
memory required for processing the font files into pixmap glyphs. I've
coupled this with a fairly complete API for drawing text and the ability
to work with all kinds of SDL surfaces, it works with OpenGL surfaces as
well as with hardware and software surfaces.
The fonts are based on the Hershey fonts, the PEX font used that is also
used in GLUT, and the new Bitstream Vera fonts with their wonderful
I hope this either solves your SDL text output problems or leads to a
simple, low cost, and effective solution.
BTW: If you know of other collections of truly free fonts, or own fonts
that you would like me to include in this library, please let me know.
By "truly" free I mean:
1) I can prove that the license you quote actually applies to the font
you tell me about. This is a real problem. A lot of sites distribute
fonts as free in violation of the actual copyright on the fonts.
2) The font license allows the creation of derivative fonts. This is
VERY important. Many "free" fonts to not allow the creation of
derivatives. PolyFonts creates derivatives.
3) You are not only allowed to create derivatives fonts, you can
4) There are no restrictions (or not worse that those of the LGPL) on
the use of the fonts in commercial works. Many fonts I have researched
are free for personal use, but not for commercial use.
PolyFonts is released under the LGPL. But, other licensing is available,
Special thanks to Henry Maddocks and the FTGL library. Without the code
in FTGL and Henry's help in modifying it for use converting TTF fonts,
there would be no PolyFonts library.
And thanks to the folks on the SDL and ALG mailing lists who helped me
figure out that several bugs were due to problems with the Version of
FreeType I was using.
+ Bob Pendleton: independent writer +
+ and programmer. +
+ email: Bob at Pendleton.com +
+ web: www.GameProgrammer.com +
More information about the SDL