Brett Bergstrom 6e79035cc3 signing off. todo in commit description
todo:
fix 0-wide chars
  minimum of 1px, minimum of some other px for spaces. chars with no width cause the base allegro_font addon to fail.
new optional param in load call to specify ranges from within the game
2026-09-22 14:37:56 -05:00
2026-09-14 17:44:01 -05:00
2026-09-14 17:44:01 -05:00
2026-09-12 06:38:30 +00:00
2026-09-12 06:38:30 +00:00

allegro_schrift

Drop-in replacement for Allegro_TTF that contains libschrift, instead of using FreeType2.

It is 100% API compatible with the vanilla TrueType addon. Compile Allegro with these files inside of /addons/ttf.

Pros:

  • It doesn't require NT 6 kernel calls
  • It doesn't dynamically link against hundreds of thousands of lines of ugly corporate-backed C code you can't read
    • Our addon is only a couple or few hundred lines, and libschrift is less than 2,000. They're compiled together.
      The original Allegro_TTF is over 1,000 lines (for a good reason) and has a relatively massive dependency weight (for a stupid reason).

Caveats:

  • Pre-stretching is not implemented.
  • The entire caching system is gone, fonts are baked to textures immediately and no further. This makes supporting some languages with this add-on inconvenient, or impossible.
    If your usecase doesn't need every fancy rendering feature and can use schrift, you probably aren't supporting enough characters and languages to need on-the-fly caching, so we consider this an acceptable tradeoff.
    • The cache_text setting in allegro5.cfg is now reused to determine what glyphs can be rendered at all. skip_cache_misses has no effect.
      When cache_text is undefined, the English and Romance alphabets will be generated by default.
Description
libschrift glue addon for Allegro, drop-in replacement for allegro_ttf
Readme 490 KiB
Languages
C 98.6%
CMake 1.4%