Add a new library to render TrueType Fonts

Issue #23 resolved
Pablo Antonio Navarro Reyes created an issue

It would improve a lot the quality and appeal of our projects to be able to use TTF fonts, with support for antialiasing, kerning and hinting.

After looking for some open source, license compatible and portable libraries (sdl_ttf, pango, etc...), I found out that many projects use and recommend FreeType. http://www.freetype.org/

It's also used by at least another game engine (LÖVE), and it's recommended in this article: http://blog.wolfire.com/2013/03/High-quality-text-rendering

Comments (5)

  1. Joseba Echevarria García repo owner

    The idea is really appealing.

    I'll have a look at freetype to see how it's used. It would be ideal if, when using scale_resolution, the text were rendered after the scaling so it wouldn't look blurred, but I don't know if that is possible with the current design of the blitter.

  2. Joseba Echevarria García repo owner

    Commit 658c490 implements all the required functionality for rendering text through Freetype 2.

    Remaining steps:

    • Bind the font loading process to PixTudio's file wrapping routines, so that we can load font files from inside Android APKs.
    • Integrate the font loading/rendering routines into the normal FNT_LOAD(), WRITE()... so that there is not usability gap when using vector fonts.
    • Adding a function to set the font size (should accept both pixels and points as font sizes).
    • Implementing a way to convert vector fonts into bitmap fonts, for faster blitting (think of a FPS counter: you probably want bitmap fonts instead of vector ones).
  3. Joseba Echevarria García repo owner

    More work is needed to add some extra functionality, but the basic features seems to be working, so I'm closing the bug report.

    Thanks for the suggestion!

  4. Log in to comment