Fonts¶
Fonts cover four distinct presentation roles—terminal/native typeface, ImGui GUI, map, and overmap—with ordered fallback, glyph coverage, metrics, hinting, antialiasing, and GPU-resource recovery.
Authoritative paths¶
doc/user-guides/FONT_OPTIONS.md explains user configuration. src/font_loader.cpp defines the
accepted string/object/array forms, hinting values, migration, and mandatory Unifont fallback.
src/sdl_font.* owns runtime font instances and glyph/texture caches. Bundled files live under
data/font/.
Configuration contract¶
typeface, gui_typeface, map_typeface, and overmap_typeface may be one path or an ordered
fallback list. Object entries can declare path, hinting, and antialiasing. Preserve the
fallback that supplies missing Unicode glyphs; a Latin-only visual check is insufficient.
Contributor workflow¶
Confirm the font's redistribution and embedding license before adding a binary. Record source, version, author/foundry, license, subset/transformation, and expected role. Do not replace a font file under the same name without reviewing metrics, coverage, package size, and attribution.
Validation¶
Test Latin, Simplified/Traditional Chinese, combining marks, wide characters, symbols, fallback, line drawing, narrow UI, map/overmap alignment, DPI/scaling, hinting modes, and renderer reset. Check both SDL2 and SDL3 where texture lifecycle differs.
Performance and ownership¶
Font objects own cached glyph textures; renderer recovery releases/rebuilds or lazily repopulates them. Unbounded glyph/color caches can consume GPU memory. Font paths and metadata persist in user configuration; GPU resources never do.
Generated data¶
Do not commit local font caches or atlases. A deliberately generated subset may be tracked only with its reproducible generator, source license, Unicode coverage input, and validation.