Skip to content

Say which glyphs the built-in font actually has - #462

Merged
tannevaled merged 1 commit into
mainfrom
bitmap-coverage
Sep 7, 2026
Merged

Say which glyphs the built-in font actually has#462
tannevaled merged 1 commit into
mainfrom
bitmap-coverage

Conversation

@tannevaled

Copy link
Copy Markdown
Contributor

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.

Measured:

' and absent — the rule is right
- drawn, 5 pixels — the rule is wrong
absent
é absent

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) and BitmapMissing(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

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>
@tannevaled
tannevaled merged commit 3bc42df into main Sep 7, 2026
1 check passed
@tannevaled
tannevaled deleted the bitmap-coverage branch September 7, 2026 18:05
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.

1 participant