Unicode Text

This library can be used to render UTF-8 encoded Unicode text to a texture (e.g. with tga_encoder). It is intended to be used from code that needs to render in-game signs.

API / Library

Download (323 KB)

How do I install this?

unicode_text provides code to render UTF-8 Unicode text to a pixels table.

The resulting pixels table can be written to a file using tga_encoder.

unicode_text can load font files in GNU Unifont hexfont format.

README: https://git.minetest.land/erlehmann/unicode_text

Reviews

Review

Do you recommend this mod?

  • Impressive, even if very incomplete

    This is the mod we've been all waiting for: A clean method to render Unicode glyphs, based on the GNU Unifont.

    I think GNU Unifont with its 16×16 pixel glyphs is just perfect for Minetest, there aren't many other fonts with such a huge coverage of the Unicode code space. And Pixel style is good for many retro-style games.

    There are nice features like kerning and color selection.

    However, while Unifont may cover the entire Unicode BMP and more, that doesn't mean this mod can render them all properly. Some writing systems are very complex and require additional adjustments. So any users of this mod need to be aware of these limitations:

    • Bidirectional Algorithm is not correctly implemented
    • Many complex writing systems have additional writing rules that would need more code to make them work. For example, rendering Arabic not only requires the bidi algorithm but also you need to draw the glyphs differently depending on where they are in the word. (Note: This is a limitation of Unifont as well.)
    • Complex combining marks are not supported well. The code admits they are hacky

    But still, this mod is a massive improvement of what we had before. I will include a modified version of this mod in Repixture.

    1 comments

Used By