Repository navigation
Conversation
-defaultSystemFontName ended on "Helvetica", which a system with Noto and no DejaVu doesn't have, so NSFont found no system font and no text was drawn, though usable fonts were installed. The bold and fixed-pitch defaults already ask fontconfig. Ask it for sans-serif here too, after the list, so that systems which have one of the listed fonts look as they did. "Helvetica" stays as the name to end on when fontconfig has nothing. Testing: Tests/cairo/defaultsystemfont.m gives fontconfig a directory holding one installed font that isn't on the list, and skips if there is none. It checks that the system font and the user font exist and that the system font has glyphs, which guards against the default naming a font nothing has. Without this change 3 of its 4 checks fail; with it all 4 pass. Not covered: a system with no fonts at all, where there is still no font. AI assistance: this change, its test and this description were written with Claude (Anthropic's Claude Code). Co-Authored-By: Claude <noreply@anthropic.com>
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.
With none of the fonts on the fontconfig backend's list installed,
-defaultSystemFontNameended on "Helvetica", which such a system usually doesn't have. A machine with Noto and no DejaVu then found no system font and drew no text, though usable fonts were installed:This finishes what #172 and #178 left of #170. They made
-defaultBoldSystemFontNameand-defaultFixedPitchFontNameask fontconfig; this asks it for sans-serif too, after the list, so systems which have a listed font look as they did. "Helvetica" stays as the name to end on when fontconfig has nothing.Testing:
Tests/cairo/defaultsystemfont.mgives fontconfig a directory holding one installed font that isn't on the list, and skips if there is none. It checks that the system font and the user font exist and that the system font has glyphs, which guards against the default naming a font nothing has. Against masterd378734, with the cairo backend under Xvfb: without this change 3 of its 4 checks fail; with it all 4 pass. The whole test suite goes from 287 passed, 3 failed to 290 passed, 0 failed, and those 3 failures are this test.Not covered: a system with no fonts at all, where there is still no font.
Investigated, reproduced and written up with AI assistance (Claude).