Repository navigation
Conversation
Preload Figtree's Latin file when neta-pixel (or neta-pixel-dark) resolves, serve it from a same-URL @font-face, and fall back to a metric-matched Arial stand-in so the swap does not move text on public pages. Cohub Session: https://cohub.live/spaces/ead34bb8-3796-4c07-8f80-2ecc7b8e9411/sessions/4df2dafb-5eea-453a-b238-118f614ad274
Drop the static copy of the Figtree Latin file. The preload URL comes from the hashed fontsource asset via hooks.server.ts, so the font is served with the immutable cache header and the same URL as the @font-face. Add a bold Arial fallback (weight 501-900) with its own size-adjust. Cohub Session: https://cohub.live/spaces/ead34bb8-3796-4c07-8f80-2ecc7b8e9411/sessions/4df2dafb-5eea-453a-b238-118f614ad274
Collaborator
Author
|
reopen after #536 lands |
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.
Summary
Visitors who pick the neta-pixel theme (or neta-pixel-dark) see Figtree on public pages. Figtree loads late and swaps in over the fallback, so text reflows.
Figtree Fallbackvalues:size-adjust: 99.8986%,ascent-override: 95.0965%,descent-override: 25.0254%,line-gap-override: 0%. size-adjust is the ratio of Figtree to Arimo text width (Chrome, 16 px, English pricing and docs text: 0.998986). Ascent and descent are Figtree's hhea 950/250 divided by that ratio.packages/sdk/src/board/model/themes.tsis regenerated (generate:board-themes) because the Board font stack now lists the fallback.@fontsource-variable/figtreewith its OFL licence.Does not touch
app.css. #536 edits the Geist imports inapp.cssand adds a root preload, and both touch the font setup. Whichever lands second rebases.Evidence
Measured on a production build served as cohub.live (HTTP/2 and HTTP/1 for warm visits), Chrome, neta-pixel set in localStorage. Medians of 3 runs. Full numbers and screenshots: https://public.cohub.live/p/ead34bb8-3796-4c07-8f80-2ecc7b8e9411/figtree-cls/SUMMARY.md
Font swap alone (app JS blocked, so only the theme script and fonts run), CLS:
Default theme (no stored choice): /pricing 390 and 1440 Lighthouse and scroll match main to four decimals. No Figtree request. Dark and neta-studio load only Geist.
Second visit (warm cache): Figtree renders on the second visit. The font file is revalidated rather than served from cache, because the adapter only marks
/_app/immutable/*as immutable./zh/pricing 390 from-load is bimodal on main (about 0.04 or 0.33 per run), and this PR lands in the 0.33 mode, as the default theme does. Remaining CLS is not font-related. On both main and the default theme, the FAQ and plans sections reflow during hydration, and that is what makes up the numbers above. #536 targets that.
Not covered: a live cohub.live run, a combined run with #536, and Arial on macOS or Windows (only Arimo, the metric-compatible font, was installed here).
Checks:
pnpm lint(exit 0; the warnings listed are on main),apps/webtypecheck (0 errors),apps/webtest (485 + 3 + 3 pass).Merge Danger
Door: two-way
Only neta-pixel and neta-pixel-dark change. Other themes and the default theme are unchanged.
Blast Radius: neta-pixel theme, public pages
Ramifications: one extra font request (about 20 KB) for neta-pixel visitors. The Board font stack in the SDK lists one more name, which is harmless where it is not installed.