This PR adds support for compact, texture sheet based font to font_api, and includes a new font mod unifont that supports 60000+ Unicode characters and weighs only \~1MB (even smaller than Metro!). Edit: ~2MB now in order to improve rendering performace.
Changes made to font_api (also documented in font_api/API.md):
A new optional parameter getglyph in font registration: It allows a font mod to construct its own glyph texture string (e.g. using ^[sheet) instead of the default font_{name}_{codepoint}.png.
This allows large, compact (and better compressed) sheets to be used instead of individual glyph files for a very large number of glyphs. (In comparison, the font_jp_noto mod weighs ~31MB with ~20000 chars)
The texture string returned by Font:render, when used in formspec, are now required to be escaped (minetest.formspec_escape).
This should have been done already even before this PR since texture strings, by its nature, might confuse the formspec parser anyway.
The newly added font "unifont" uses GNU Unifont, the same font also used in Minecraft (and also in texture sheet form) for Unicode display.
(See screenshot in unifont/README.md)
This PR adds support for compact, texture sheet based font to
font_api
, and includes a new font modunifont
that supports 60000+ Unicode characters and weighs only\~1MB (even smaller than Metro!). Edit: ~2MB now in order to improve rendering performace.Changes made to
font_api
(also documented in font_api/API.md):A new optional parameter
getglyph
in font registration: It allows a font mod to construct its own glyph texture string (e.g. using^[sheet
) instead of the defaultfont_{name}_{codepoint}.png
.This allows large, compact (and better compressed) sheets to be used instead of individual glyph files for a very large number of glyphs. (In comparison, the
font_jp_noto
mod weighs ~31MB with ~20000 chars)The texture string returned by
Font:render
, when used in formspec, are now required to be escaped (minetest.formspec_escape
).This should have been done already even before this PR since texture strings, by its nature, might confuse the formspec parser anyway.
The newly added font "unifont" uses GNU Unifont, the same font also used in Minecraft (and also in texture sheet form) for Unicode display.