Skip to content

Export Cyrillic glyphs and preserve existing font atlases - #3

Draft
labaznov wants to merge 2 commits into
PathOfBuildingCommunity:mainfrom
labaznov:cyrillic-notes
Draft

labaznov wants to merge 2 commits into
PathOfBuildingCommunity:mainfrom
labaznov:cyrillic-notes

Conversation

@labaznov

@labaznov labaznov commented Nov 13, 2026 •

Copy link
Copy Markdown

The generator currently exports only ASCII. This adds available Cyrillic glyphs (U+0400–U+04FF) and note punctuation (U+00AB/U+00BB/U+2013/U+2014/U+2122) using GetGlyphOutlineW and explicit GLYPH_U32 entries, while retaining the legacy sequential ASCII entries.

extend_font.py appends generated Unicode glyphs to an existing atlas. This preserves existing pixels, coordinates and metrics when the current font/rasterizer would otherwise change them, and skips Unicode codepoints already present so that extending a font again does not replace them. It requires Pillow and matching font heights. Font licensing remains separate from the generator license.

This draft is the asset-generation part of Cyrillic support for PoB Notes. It needs a corresponding SimpleGraphic reader change; it does not localize game data or the UI.

Validation on Windows with VS2022:

  • tests/fontgen_test.cpp and the asset-generation runner compiled with VS2022 x86, exit 0; 9 native tests pass. The five punctuation cases failed before the follow-up change.
  • python -m unittest discover -s tests -p test_extend_font.py: 5 tests pass, including an existing-Unicode regression that fails without the duplicate-codepoint guard.
  • Generated Liberation Sans 2.1.5 assets at all 16 existing heights: original ASCII and Cyrillic metadata and atlas pixels remain identical after extension; all 80 new punctuation glyphs have nonempty pixels. The actual renderer passes 1,345 font/color/cursor checks.
  • git diff --check: exit 0.

The README documents the format and reproduction commands. The Python tests use generated temporary fixtures; no font binaries are added to this repository.

Companion drafts: SimpleGraphic #122 and PoB #10452.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant