RFS: 0ad

Adam Borowski kilobyte at angband.pl
Thu Apr 7 16:35:31 UTC 2011


On Thu, Apr 07, 2011 at 04:33:47PM +0100, Philip Taylor wrote:
> On Wed, Apr 6, 2011 at 1:24 AM, Paul Wise <pabs at debian.org> wrote:
> > On Wed, Apr 6, 2011 at 12:05 AM, Philip Taylor <excors at gmail.com> wrote:
> >>>> DejaVuSans.ttf, DejaVuSansMono.ttf, texgyrepagella-regular.otf,
> >>>> texgyrepagella-bold.otf are unmodified originals.
> >
> > It sounds like you're embedding glyphs from the fonts in bitmap
> > images.
> 
> Yes (e.g. http://trac.wildfiregames.com/browser/ps/trunk/binaries/data/mods/public/fonts/serif-14.png)
> 
> > I would suggest at minimum that you switch to doing that at
> > build-time. Preferably you would render text at run-time, since that
> > enables i18n. For finding font files use fontconfig (preferred) and or
> > a build-time parameter for finding them.
> 
> My main concern is that that wouldn't provide sufficient consistency -
> different versions of Freetype, or the same version with different
> configuration (bytecode interpreter, autohinter, etc), might render
> the same font quite differently and break the look of the game.

Why won't you force the settings then?  If you are afraid the user's
configuration might be ill-fitting, specify them by hand.

> (Getting a font that renders nicely with recolouring and textured
> backgrounds and non-native monitor resolutions and with an
> outline-stroked variant etc seems tricky - they often look fine in a
> desktop application but not in the game).

Subpixel rendering is nice, but indeed breaks with any sort of scaling. 
Monochromatic rendering looks abysmal when scaled, too.  You definitely want
greyscale antialiasing.  It can't go bad -- other choices might be better in
certain cases, but it's the most universal one.

And guess what, the image you linked to uses greyscale antialiasing.

Is the text usually shown non-scaled?  Then you might want hinting.  If not,
hinting is totally pointless.  Why should FreeType distort the text to match
a certain resolution if it will be immediately scaled?  For non-integer
multiplies, it will go wrong.

Thus, you want the following settings:
* (always) FT_LOAD_TARGET_NORMAL, plus
* (if usually scaled) FT_LOAD_NO_SCALE or FT_LOAD_NO_HINTING

-- 
1KB             // Microsoft corollary to Hanlon's razor:
                //      Never attribute to stupidity what can be
                //      adequately explained by malice.



More information about the Pkg-games-devel mailing list