Have you ever wanted pixel-perfect bitmap fonts for your SDL-based project? Search no more, the solution is here!
SDL_pcf lets you make use of thousands of X11 bitmap fonts, including terminus. It uses proven PCF format handling code straight from the latest offical release of libxfont, tailored and adapted to fit nicely with SDL.
Using PCF fonts is as simple as:
PCF_Font *font;
font = PCF_OpenFont("ter-x24n.pcf.gz");
PCF_FontWrite(font, "Hello world !", white, screenSurface, &location);
You just need to include SDL_pcf.h and call pkg-config with SDL2_pcf.
Full documentation can be found here.
Demo code is provided in test/ that can be built on Unix using make:
$ make check
$ ./test/ayba
#press <ESC> to quit
- SDL2
- zlib
- Optional support for SDL_gpu