Say which glyphs the built-in font actually has - #462
Merged
Conversation
A rune with no glyph still ADVANCES -- deliberately, so that a column of text stays lined up -- so measuring a string says nothing about whether it can be read. Until now the only way to know was to read the table, and the table was unexported, so the answer was folklore. The folklore was wrong in both directions. go-xrkit/desk carries a hand-written rule forbidding apostrophes and dashes in its settings window, arrived at after "the glasses' own menu bar" came out with a hole in it. But the plain hyphen draws fine (5 pixels), and that same window ships "Turn this Mac's screen off" -- an apostrophe, which does not. BitmapCovers(r) and BitmapMissing(s) answer it. A consumer can now assert its own strings instead of remembering a rule, which is the difference between a rule and a guard. ⚠ For the BUILT-IN font only. A TrueType face has far wider coverage; this is the fallback, and the fallback is what a platform with no system face falls back TO. Co-Authored-By: Claude Opus 5 <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 rune with no glyph still advances — deliberately, so that a column of text stays lined up — so measuring a string says nothing about whether it can be read. Until now the only way to know was to read the table, and the table was unexported, so the answer was folklore.
The folklore was wrong in both directions
go-xrkit/deskcarries a hand-written rule forbidding apostrophes and dashes in its settings window, arrived at after "the glasses' own menu bar" came out with a hole in it.Measured:
'and’-—éAnd that same window ships
Turn this Mac's screen off— an apostrophe, which does not draw. The rule is both incomplete and unenforced.What this adds
BitmapCovers(r)andBitmapMissing(s). A consumer can now assert its own strings instead of remembering a rule — which is the difference between a rule and a guard.The test also pins the property that makes this necessary: a covered and an uncovered rune measure the same. If they ever differed, callers could have used width to detect coverage, and this API would be redundant.
⚠ For the built-in font only. A TrueType face has far wider coverage; this is the fallback, and the fallback is what a platform with no system face falls back to.
🤖 Generated with Claude Code