Skip to content

Linux: skip menu fonts that have no Latin letters - #1405

Merged
NotRexed merged 2 commits into
NotRexed:mainfrom
berelels:fix/menu-font-latin
Nov 10, 2026
Merged

NotRexed merged 2 commits into
NotRexed:mainfrom
berelels:fix/menu-font-latin

Conversation

@berelels

Copy link
Copy Markdown
Contributor

What

On the native Linux build the Insert menu draws its text with stb_truetype from the first font that loads: one beside
the game (fonts/regular.ttf, fonts/bold.ttf), then fontconfig's sans-serif, then a few usual paths
(host/posix/gdi_posix.c). Nothing checked that the font has Latin letters. A font without them draws every letter
as its empty box (.notdef, glyph 0): rows of hollow squares, while the same folder under Wine reads fine (#1279).

  • A font without a glyph for A is now passed over for the next candidate.
  • fontconfig is asked for sans-serif:lang=en (and sans-serif:bold:lang=en): its choice among the fonts that
    have the menu's letters.

I could not tell which font the reporter's system returns; with fonts on my machine, stb_truetype draws exactly that
box for every font without Latin letters.

Tests

  • tests/test_menu_font_latin.py (new, Linux only, skipped on Windows): builds two tiny TrueType fonts, one with
    A and one with only a Hebrew letter. The second goes beside the game, and a stand-in fc-match on PATH answers
    with the first. gdi_posix.c is compiled with a fixture that draws "A" in both weights: both must draw pixels,
    and fc-match must be asked with lang=en. No system font is used. It fails on the current code and with
    either half of the change taken out.
  • Full suite on Linux: the same failures as on main (my environment); nothing new fails.
  • Not tested: the game itself, and the reporter's system.

Refs #1279

AI assistance

Assisted-by: Claude Opus 5.5
Assisted-by: Nemotron 3 Ultra 550B (LLM council)
Assisted-by: gpt-oss-120b (LLM council)
Assisted-by: dots-3-note-preview (LLM council)
Assisted-by: Gemini 3.5 Flash-Lite (LLM council)
Co-Authored-By: Claude Opus 5.5 noreply@anthropic.com

The LLM council (several models answer the same question independently, then
rank each other's answers anonymously) was used to define the approach and the
solution: which problem to take on, how to fix it and what to avoid. It saw a
summary of the issues, not the code. The change and its test were written with
Claude Code, then reviewed and tested by me.

On the native Linux build the Insert menu draws its text with the first
font that loads: one beside the game, then fontconfig's sans-serif, then
a few usual paths. A font with no Latin letters drew every letter as its
empty box (.notdef), so the menu was rows of hollow squares, while the
same folder under Wine read fine (issue 1279).

A font without a glyph for 'A' is now passed over for the next one, and
fontconfig is asked for sans-serif:lang=en, its choice among the fonts
that have the menu's letters.

tests/test_menu_font_latin.py builds two tiny fonts, one with 'A' and
one with only a Hebrew letter, puts the second beside the game, and a
stand-in fc-match answers with the first: "A" must draw in both weights,
and fc-match must be asked with lang=en. No system font is used. It
fails on the old code and with either half of the change taken out.

Refs NotRexed#1279

The LLM council (several models answer the same question independently,
then rank each other's answers anonymously) was used to define the
approach and the solution: which problem to take on, how to fix it and
what to avoid. It saw a summary of the issues, not the code. The change
and its test were written with Claude Code, then reviewed and tested by me.

Assisted-by: Claude Opus 5.5
Assisted-by: Nemotron 3 Ultra 550B (LLM council)
Assisted-by: gpt-oss-120b (LLM council)
Assisted-by: dots-3-note-preview (LLM council)
Assisted-by: Gemini 3.5 Flash-Lite (LLM council)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@NotRexed

Copy link
Copy Markdown
Owner

This landed in the v2.0.12 branch (merged there for testing; it reaches main with that release), so closing. Thanks!

@NotRexed

Copy link
Copy Markdown
Owner

Reopened: closing this was a mistake on my side. It was tested in the v2.0.12 branch, and it will be merged into main here, so it shows as merged. Sorry for the noise.

@NotRexed NotRexed reopened this Nov 10, 2026
…en matches on main's font index and face_match)
@NotRexed
NotRexed merged commit 03bce9b into NotRexed:main Nov 10, 2026
6 of 8 checks passed
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.

2 participants