Repository navigation
Pick the generic BUCKET, not the whole font family - #34
Merged
Merged
Conversation
css.FontFamily used to be an enum of three values, so comparing the value
itself was comparing the bucket. Since it became {Names, Generic}
(go-webengine/engine#233) a declaration that NAMES a family — `Spectral,
Georgia, serif`, which is every real page — matched none of the bare buckets
and fell through to the default.
So every serif and monospace run was being embedded in the sans face. On the
A0 poster this module is exercised on, the file went from Inter + Lora + Go
Mono down to Inter alone: all its body serif and all its figures' monospace
silently reset to a sans face.
This is mine, from that type change, and it is a live regression on main —
hence a fix of its own rather than a line inside the @font-face work that
found it.
Both new tests fail on the previous code, verified by restoring fonts.go
alone: pick sends a named serif to the sans face, and an exported document
naming a serif and a monospace family embeds no Lora and no Go Mono.
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 live regression on main, and mine.
css.FontFamilyused to be an enum of three values, so comparing the value itself was comparing the bucket. Since it became{Names, Generic}(go-webengine/engine#233) a declaration that names a family —Spectral, Georgia, serif, which is every real page — matches none of the bare buckets and falls through to the default.So every serif and monospace run was being embedded in the sans face. Measured on the A0 poster this module has been exercised on all day, the embedded font list went from
down to
All its body serif and all its figures' monospace, silently reset to a sans face.
The fix is
switch fam.Genericinstead ofswitch fam, in the one place that switched on the value.This is a fix of its own rather than a line inside the
@font-facework that found it, because main is broken now.Both new tests fail on the previous code — verified by restoring
fonts.goalone:picksends a named serif family to the sans face, and an exported document naming a serif and a monospace family embeds no Lora and no Go Mono.