GNU Font Utils and Font Rendering (was Re: SDL, SGE, & FreeType)

Enzo wrote:

Dido Sevilla wrote:

Best bet would be not to use FreeType except internally to generate
bitmap fonts based the TTF’s you use. This is the safest course of
action to take as of now.

In my previous programs (MS-DOS games), I created a simple format
for bitmapped font, and I made a simple utility TTF2FON that translates
fonts.
Technically bitmap fonts are faster, but changing size and style
dinamically is a great feature (and blitting can be optimized by
converting font in bitmap format in memory when requested).

Now, with truetype’s patents, I wonder if anyone (maybe GNU project)
has already created a new vectorial font format with truetype’s
features.

Yes, they have, except that the format seems to be geared more to
paper-text fonts rather than the onscreen display fonts we are more
interested in. There’s something called the GNU Font Utilities which
has been at Version 0.6 since 1992, way before the TTF spec became
important, and doesn’t seem to have been updated since (jeez, I was a
High School sophomore back then!). Has got some interesting tools
mainly of use to the folk who use LaTeX and METAFONT. They introduce a
.bez font format which is essentially what TrueType is about. Also
interesting stuff for converting bitmap representations of text in some
font into a vector format. Unfortunately, I think it would be a lot of
work to adapt it to the onscreen typography which we are interested in,
but also looks like a worthwhile project for those who have the time.

I’ve already thought up a way to perform antialiased font rendering
that’s different from what the TrueType spec describes, I think. Render
a font from a master TrueType or other vector format a character image
at a very very large point size–perhaps 500 pixels or even more–in
bilevel. Then resample the image so that you have the desired character
point size; weighted area sampling ought to smooth out the artifacts
inherent in this process. This is a time-consuming and memory-hungry
process, of course, but then again, for most games, and even most
windowing-system graphics as well, only need a few fonts and a few point
sizes. This scheme I propose would encode all fonts as extremely large
bitmaps (literal bitmaps; they’re bilevel images) compressed with some
efficient lossless scheme such as JBIG. They’d probably compress very
well.–

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

College of Engineering, University of the Philippines, Diliman