paint: fall back to DejaVu Sans for a character the family has no glyph for - #145
Merged
Merged
Conversation
…ph for A character the family's face had no glyph for drew as nothing — the user's report lost its "↔" and circled digits — where a browser falls back per character to the system's fonts. Fonts now carries DejaVu Sans (go-opentype/fonts/dejavusans: arrows, mathematical operators, box drawing, geometric shapes, braille, Greek, Cyrillic, ①–⑩ — breadth, not looks) as the last resort: Runs splits a text into the stretches the family sets and those the fallback sets (a character neither covers, CJK, stays with the family), Measure sums both faces' advances so layout reserves the room, and drawText walks the same runs. A consumer that sets the same text elsewhere — a PDF exporter embedding both fonts — walks Runs too, so its glyphs come from the faces the layout measured with. The fonts module moves to the DejaVu-bearing commit, which also brings a newer Inter that covers arrows and ①–⑩ itself (Lora and Go Mono do not); every existing fixture and pixel test is unchanged by the bump. Co-Authored-By: Claude Fable 5.1 <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.
A character the family's face has no glyph for drew as nothing (a user's report lost its
↔and circled digits yesterday); a browser falls back per character to the system's fonts.paint.Fontsnow carries DejaVu Sans as the last resort (go-opentype/fonts#18,dejavusans):Fonts.Runs(text, family, weight, italic) []Run{Text, Fallback}splits a text by glyph coverage (whitespace joins the run it is in; a character neither covers — CJK — stays with the family);Measuresums both faces' advances, so layout reserves the room;drawTextwalks the same runs;Runstoo, so its glyphs come from the faces the layout measured with.The fonts module moves to
v0.9.1-0.20260907071658-dd9656234a3d(opentype v0.12.0 with it); its newer Inter covers↔and ①–⑩ by itself, Lora and Go Mono do not. Every existing fixture and pixel test is unchanged by the bump; paint stays at 100 % (tests: coverage split per family, measured widths, inked pixels, face cache).🤖 Generated with Claude Code