Font libraries

All this talk about SDL_TTF has me wondering. What if I want to use other types of fonts with SDL? Is there an OpenType library? What about PostScript or old-school bitmapped fonts?

All this talk about SDL_TTF has me wondering. What if I want to use
other types of fonts with SDL? Is there an OpenType library? What about
PostScript or old-school bitmapped fonts?

SDL_TTF uses freetype, and can open OpenType fonts. FreeType can open
PostScript fonts too but I’ve never tried it with SDL_TTF. For bitmaps,
there’s SDL_bdf: http://www.geocities.com/andre_leiradella/#sdl_bdf

GregoryOn Wed, 8 Apr 2009, Mason Wheeler wrote:

All this talk about SDL_TTF has me wondering. What if I
want to use other types of fonts with SDL? Is there an
OpenType library? What about PostScript or old-school
bitmapped fonts?

SDL_TTF uses freetype, and can open OpenType fonts.
FreeType can open PostScript fonts too but I’ve never tried
it with SDL_TTF. For bitmaps, there’s SDL_bdf:
http://www.geocities.com/andre_leiradella/#sdl_bdf

I just looked that up. It’s scary! Looks to me like it takes a
SetPixel callback and calls that repeatedly in a for loop
for every pixel. I’ve seen several discussions about
setting individual pixels on a SDL_Surface on here.
Isn’t that supposed to be horribly slow? I need to be able
to render arbitrary amounts of text pretty much in real
time. (I don’t think I’ll be using bitmapped fonts too much,
but if I do, something like this just won’t work. Especially
as it only supports ANSI characters.)>----- Original Message ----

From: Gregory Smith
Subject: Re: [SDL] Font libraries
On Wed, 8 Apr 2009, Mason Wheeler wrote:

NFont does bitmap fonts and (optionally) wraps SDL_TTF…

Jonny DOn Wed, Apr 8, 2009 at 3:22 PM, Mason Wheeler wrote:

----- Original Message ----

From: Gregory Smith
Subject: Re: [SDL] Font libraries

On Wed, 8 Apr 2009, Mason Wheeler wrote:

All this talk about SDL_TTF has me wondering. ?What if I
want to use other types of fonts with SDL? ?Is there an
OpenType library? What about PostScript or old-school
bitmapped fonts?

SDL_TTF uses freetype, and can open OpenType fonts.
FreeType can open PostScript fonts too but I’ve never tried
it with SDL_TTF. For bitmaps, there’s SDL_bdf:
http://www.geocities.com/andre_leiradella/#sdl_bdf

I just looked that up. ?It’s scary! ?Looks to me like it takes a
SetPixel callback and calls that repeatedly in a for loop
for every pixel. ?I’ve seen several discussions about
setting individual pixels on a SDL_Surface on here.
Isn’t that supposed to be horribly slow? ?I need to be able
to render arbitrary amounts of text pretty much in real
time. ?(I don’t think I’ll be using bitmapped fonts too much,
but if I do, something like this just won’t work. ?Especially
as it only supports ANSI characters.)


SDL mailing list
SDL at lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org

All this talk about SDL_TTF has me wondering. What if I
want to use other types of fonts with SDL? Is there an
OpenType library? What about PostScript or old-school
bitmapped fonts?
SDL_TTF uses freetype, and can open OpenType fonts.
FreeType can open PostScript fonts too but I’ve never tried
it with SDL_TTF. For bitmaps, there’s SDL_bdf:
http://www.geocities.com/andre_leiradella/#sdl_bdf

I just looked that up. It’s scary! Looks to me like it takes a
SetPixel callback and calls that repeatedly in a for loop
for every pixel. I’ve seen several discussions about
setting individual pixels on a SDL_Surface on here.
Isn’t that supposed to be horribly slow? I need to be able
to render arbitrary amounts of text pretty much in real
time. (I don’t think I’ll be using bitmapped fonts too much,
but if I do, something like this just won’t work. Especially
as it only supports ANSI characters.)

Hahaha, yeah, it wasn’t written with performance in mind, but with
flexibility, so it knows nothing about SDL_Surfaces and bpp. You can
always draw individual characters or lines of text to SDL_Surfaces and
keep them around to be blited when needed.

And it does has provision for non-ANSI characters. SDL_bdf can draw any
character defined in the font file, and in fact got some use from people
trying to render text in Chinese and other languages.

Cheers,

Andre