Repository navigation
Linux: skip menu fonts that have no Latin letters - #1405
Merged
Merged
Conversation
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>
Owner
|
This landed in the v2.0.12 branch (merged there for testing; it reaches |
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. |
…en matches on main's font index and face_match)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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'ssans-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 letteras its empty box (.notdef, glyph 0): rows of hollow squares, while the same folder under Wine reads fine (#1279).
Ais now passed over for the next candidate.sans-serif:lang=en(andsans-serif:bold:lang=en): its choice among the fonts thathave 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 withAand one with only a Hebrew letter. The second goes beside the game, and a stand-infc-matchon PATH answerswith the first.
gdi_posix.cis compiled with a fixture that draws "A" in both weights: both must draw pixels,and
fc-matchmust be asked withlang=en. No system font is used. It fails on the current code and witheither half of the change taken out.
main(my environment); nothing new fails.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.