The PolyFonts library

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
library: http://gameprogrammer.com/polyfonts/polyfonts.html

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
license.

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
    distribute them

  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,
but ask.

	Bob Pendleton

P.S

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.

P.P.S.

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 wrote:

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
library: http://gameprogrammer.com/polyfonts/polyfonts.html

Bob,

I downloaded the tarball, built it, and played with the demos.

A quick, initial reaction: This is really neat! :slight_smile:

Slightly longer, more measured reaction:

There are several text solutions for SDL - SFont and SDL_ttf spring
to mind - but I can see real advantages to the approach you’ve taken
with PolyFonts. I like the idea of “built-in” fonts, with no
external dependencies - no .TTF files to install, or worries about
the version of SDL_ttf or FreeType that the user has installed.
Also, PolyFonts seems very flexible in what it can do - rotated
text, skewing, etc. - more so than any bitmapped font library could
hope to do.

Of course, every approach has its disadvantages, too. The main
one I can think of with PolyFonts is that the user is limited to
the supplied list of fonts. I realise that “free” fonts are hard
to come by, but would it be possible to provide a tool for
generating the font data from an existing TTF file? The comments
at the top of the font files and on your website suggest that such a
tool exists - would it not be easier to just release it along with
the library? The decision about whether a font satisfied the legal
requirements of an application’s licence could then be left up to
the user - I don’t think it could rebound on you if someone converted
a commercial font for use with PolyFonts, as long as you didn’t distribute
the converted data - or am I wrong?

Anyway, it’s your library, so I guess you get to make the rules. :slight_smile:

One minor quibble - the tarball unpacks files into the current
directory - it would be nicer if it created a subdirectory and unpacked
into that.

But all in all, it looks like a really useful piece of software -
thanks for releasing it under the LGPL!

Regards,

Lorcan Hamill

Bob Pendleton wrote:

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
library: http://gameprogrammer.com/polyfonts/polyfonts.html

Bob,

I downloaded the tarball, built it, and played with the demos.

A quick, initial reaction: This is really neat! :slight_smile:

Thank you!

Slightly longer, more measured reaction:

There are several text solutions for SDL - SFont and SDL_ttf spring
to mind - but I can see real advantages to the approach you’ve taken
with PolyFonts. I like the idea of “built-in” fonts, with no
external dependencies - no .TTF files to install, or worries about
the version of SDL_ttf or FreeType that the user has installed.
Also, PolyFonts seems very flexible in what it can do - rotated
text, skewing, etc. - more so than any bitmapped font library could
hope to do.

That was the idea.

Of course, every approach has its disadvantages, too. The main
one I can think of with PolyFonts is that the user is limited to
the supplied list of fonts. I realise that “free” fonts are hard
to come by, but would it be possible to provide a tool for
generating the font data from an existing TTF file? The comments
at the top of the font files and on your website suggest that such a
tool exists - would it not be easier to just release it along with
the library? The decision about whether a font satisfied the legal
requirements of an application’s licence could then be left up to
the user - I don’t think it could rebound on you if someone converted
a commercial font for use with PolyFonts, as long as you didn’t distribute
the converted data - or am I wrong?

I have not been able to determine to my satisfaction whether or not I
can release the conversion tool without possibly finding my self in
violation of the DMCA. Considering the cost, and fallibility, of legal
help and my current financial situation… It just isn’t worth the risk.

I have found several hundred more fonts that I may be able to convert.

Anyway, it’s your library, so I guess you get to make the rules. :slight_smile:

I wish that were the case. Right now I am working out of pure paranoia.

	Bob PendletonOn Sun, 2003-07-20 at 19:00, Lorcan Hamill wrote:

One minor quibble - the tarball unpacks files into the current
directory - it would be nicer if it created a subdirectory and unpacked
into that.

But all in all, it looks like a really useful piece of software -
thanks for releasing it under the LGPL!

Regards,

Lorcan Hamill


SDL mailing list
SDL at libsdl.org
http://www.libsdl.org/mailman/listinfo/sdl

±----------------------------------+

Bob Pendleton wrote:

I have not been able to determine to my satisfaction whether or not I
can release the conversion tool without possibly finding my self in
violation of the DMCA. Considering the cost, and fallibility, of legal
help and my current financial situation… It just isn’t worth the risk.

Ooopps! You know, for a moment there when I was writing my earlier mail,
I thought we were still living in an age when lawmakers at least tried
to make sensible laws - I had completely forgotten about the DMCA.
Since I don’t live in the US, it doesn’t apply to me - but apparently
the EU is heading in a similar direction. :frowning:

So, before this turns into an off-topic rant, I’ll just say that
I now understand your position not to release the conversion tool -
I’d probably do the same thing is your situation, once I’d thought
about it.

I have found several hundred more fonts that I may be able to convert.

Excellent!

Anyway, it’s your library, so I guess you get to make the rules. :slight_smile:

I wish that were the case. Right now I am working out of pure paranoia.

Probably a sensible approach, sadly.

Cheers,

Lorcan Hamill

just FYI and i know its kinda off topic but the DMCA is the US’s version of
an international treaty made by the WTO so it applies to many diff
countries.

i will zip my lips at that but if anyone wants more info check out this
page!

http://anti-dmca.org/> ----- Original Message -----

From: lh-sdl@lorcanhamill.com (Lorcan Hamill)
To:
Sent: Monday, July 21, 2003 3:33 PM
Subject: Re: [SDL] The PolyFonts library

Bob Pendleton wrote:

I have not been able to determine to my satisfaction whether or not I
can release the conversion tool without possibly finding my self in
violation of the DMCA. Considering the cost, and fallibility, of legal
help and my current financial situation… It just isn’t worth the risk.

Ooopps! You know, for a moment there when I was writing my earlier mail,
I thought we were still living in an age when lawmakers at least tried
to make sensible laws - I had completely forgotten about the DMCA.
Since I don’t live in the US, it doesn’t apply to me - but apparently
the EU is heading in a similar direction. :frowning:

So, before this turns into an off-topic rant, I’ll just say that
I now understand your position not to release the conversion tool -
I’d probably do the same thing is your situation, once I’d thought
about it.

I have found several hundred more fonts that I may be able to convert.

Excellent!

Anyway, it’s your library, so I guess you get to make the rules. :slight_smile:

I wish that were the case. Right now I am working out of pure paranoia.

Probably a sensible approach, sadly.

Cheers,

Lorcan Hamill


SDL mailing list
SDL at libsdl.org
http://www.libsdl.org/mailman/listinfo/sdl

El dom, 20 de 07 de 2003 a las 18:55, Bob Pendleton escribi?:

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
library: http://gameprogrammer.com/polyfonts/polyfonts.html

Well,. very very cool piece of code, but… what about external fonts?
It should allow users to load fonts from files, think not all SDL
developers are GAME ones, if you add this functionality I’ll SURE use
your library. I was thinking in write my own a lot of time, at the
moment don’t know if I will, but… what for? there is already a very
good thing, and structures/data are there… drop them to files! ;)–
pirata <@pirata>
-------------- next part --------------
A non-text attachment was scrubbed…
Name: smiley-4.png
Type: image/png
Size: 822 bytes
Desc: not available
URL: http://lists.libsdl.org/pipermail/sdl-libsdl.org/attachments/20030721/1603699a/attachment.png

El dom, 20 de 07 de 2003 a las 18:55, Bob Pendleton escribi?:

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
library: http://gameprogrammer.com/polyfonts/polyfonts.html
Well,. very very cool piece of code, but… what about external fonts?
It should allow users to load fonts from files, think not all SDL
developers are GAME ones, if you add this functionality I’ll SURE use
your library. I was thinking in write my own a lot of time, at the
moment don’t know if I will, but… what for? there is already a very
good thing, and structures/data are there… drop them to files! :wink:

It never occurred to me to use my font format for external files… It
would be nearly trivial to write a program that would dump one of these
fonts to a file and add a function to load it. It would not be as
compact as the current .c files.

Do you mind telling me what applications you see needing the abilities
you ask for?

Does the world really need another font file format?

	Bob PendletonOn Mon, 2003-07-21 at 21:47, pirata wrote:

pirata

±----------------------------------+

I think that better alternative would be a loader lib that could use
SDL_ttf to load and convert ttf fonts as polyfonts. This would let
people to make programs that can use any ttf fonts without compromising
the efficiency of programs that only need couple specific fonts and
thus those can be included in the binary without unnecessary loading
code.On Tuesday 22 July 2003 06:54, Bob Pendleton wrote:

On Mon, 2003-07-21 at 21:47, pirata wrote:

El dom, 20 de 07 de 2003 a las 18:55, Bob Pendleton escribi?:

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 library:
http://gameprogrammer.com/polyfonts/polyfonts.html

Well,. very very cool piece of code, but… what about external
fonts? It should allow users to load fonts from files, think not
all SDL developers are GAME ones, if you add this functionality
I’ll SURE use your library. I was thinking in write my own a lot of
time, at the moment don’t know if I will, but… what for? there is
already a very good thing, and structures/data are there… drop
them to files! :wink:

It never occurred to me to use my font format for external files…
It would be nearly trivial to write a program that would dump one of
these fonts to a file and add a function to load it. It would not be
as compact as the current .c files.

Do you mind telling me what applications you see needing the
abilities you ask for?

Does the world really need another font file format?

El dom, 20 de 07 de 2003 a las 18:55, Bob Pendleton escribi?:

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 library:
http://gameprogrammer.com/polyfonts/polyfonts.html

Well,. very very cool piece of code, but… what about external
fonts? It should allow users to load fonts from files, think not
all SDL developers are GAME ones, if you add this functionality
I’ll SURE use your library. I was thinking in write my own a lot of
time, at the moment don’t know if I will, but… what for? there is
already a very good thing, and structures/data are there… drop
them to files! :wink:

It never occurred to me to use my font format for external files…
It would be nearly trivial to write a program that would dump one of
these fonts to a file and add a function to load it. It would not be
as compact as the current .c files.

Do you mind telling me what applications you see needing the
abilities you ask for?

Does the world really need another font file format?

I think that better alternative would be a loader lib that could use
SDL_ttf to load and convert ttf fonts as polyfonts. This would let
people to make programs that can use any ttf fonts without compromising
the efficiency of programs that only need couple specific fonts and
thus those can be included in the binary without unnecessary loading
code.

Yeah, that is the conclusion I came to about 30 minutes after I posted
my reply. That loader lib would be fun to write. Someday…

	Bob PendletonOn Tue, 2003-07-22 at 12:09, Sami N??t?nen wrote:

On Tuesday 22 July 2003 06:54, Bob Pendleton wrote:

On Mon, 2003-07-21 at 21:47, pirata wrote:


SDL mailing list
SDL at libsdl.org
http://www.libsdl.org/mailman/listinfo/sdl

±----------------------------------+

El mar, 22 de 07 de 2003 a las 00:54, Bob Pendleton escribi?:

It never occurred to me to use my font format for external files… It
would be nearly trivial to write a program that would dump one of these
fonts to a file and add a function to load it. It would not be as
compact as the current .c files.

Do you mind telling me what applications you see needing the abilities
you ask for?

Yes, a Window System, I’m writing one, as mentioned some time ago

Does the world really need another font file format?

Sorry but… YES. Why?, because the library will not in turn “depend” on
another one, so it will not overhead apps (and dependecies), and
programmers/users will not worry about patent issues, neither for a
particular font nor for render engine.
The only format that provides nice ‘big size’ font is TTF, but it falls
in font copyrights & decompresion patents.>

  Bob Pendleton


pirata <@pirata>

El mar, 22 de 07 de 2003 a las 00:54, Bob Pendleton escribi?:

It never occurred to me to use my font format for external files… It
would be nearly trivial to write a program that would dump one of these
fonts to a file and add a function to load it. It would not be as
compact as the current .c files.

Do you mind telling me what applications you see needing the abilities
you ask for?
Yes, a Window System, I’m writing one, as mentioned some time ago

Well, yeah I can see why you want loadable fonts. I can see that a lot
of people writing editors would want the same thing.

Does the world really need another font file format?
Sorry but… YES. Why?, because the library will not in turn "depend"
on another one, so it will not overhead apps (and dependecies), and
programmers/users will not worry about patent issues, neither for a
particular font nor for render engine.
The only format that provides nice ‘big size’ font is TTF, but it
falls in font copyrights & decompresion patents.

I see your point. The problem is that switching to a new format will not
get rid of the copyright problems on fonts. The majority of fonts are
covered by very restrictive copyrights and those copyrights would follow
them even if they were converted to the new format. The rest of what you
said is true though.It does net away from the patent issues and my .c
files are pretty compact.

There are older types of outline fonts. Take a look at the X font server
and the outline fonts that come with it. Outline fonts have a long
history.

Changing the subject slightly, what I am hearing from folks is that
people would like a way to convert TrueType fonts for use with polyfonts
and a way to load fonts at runtime. There are a lot of variations on
these goals. It sounds like it would be ok to have my own font format if
there is a standalone TTF => PolyFonts converter. Though some people
want a separate library to load TrueType fonts at runtime.

Ok, I’m going to be blunt, I don’t have time to work on those projects
right now. I develop what I need for my projects and I release what
seems reasonable to me to release. If you folks want these features, go
to my web site http://www.gameprogrammer.com and click on the “make a
donation” button. I’ll work on these projects in proportion to the
contributions.

	Bob PendletonOn Tue, 2003-07-22 at 19:25, pirata wrote:

pirata

±----------------------------------+