Skip to content

Pick the generic BUCKET, not the whole font family - #34

Merged
tannevaled merged 1 commit into
mainfrom
fix-generic-bucket-regression
Sep 27, 2026
Merged

tannevaled merged 1 commit into
mainfrom
fix-generic-bucket-regression

Conversation

@tannevaled

Copy link
Copy Markdown
Contributor

A live regression on main, and mine.

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 — 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

GoMono  Inter-Italic  Inter-Regular  Lora-Italic  Lora-Regular

down to

Inter-Italic  Inter-Regular

All its body serif and all its figures' monospace, silently reset to a sans face.

The fix is switch fam.Generic instead of switch fam, in the one place that switched on the value.

This is a fix of its own rather than a line inside the @font-face work that found it, because main is broken now.

Both new tests fail on the previous code — verified by restoring fonts.go alone: pick sends 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.

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>
@tannevaled
tannevaled merged commit 57de929 into main Sep 27, 2026
1 check passed
@tannevaled
tannevaled deleted the fix-generic-bucket-regression branch September 27, 2026 18:23
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