Repository navigation
A house font set and twelve pairings as shared data - #32
Merged
Merged
Conversation
src/data/type.ts: sixteen families (fifteen Fontsource packages under OFL-1.1 or Apache-2.0, plus the device's own sans) and twelve pairings, each mapped to the style boards whose type classes it matches. Data only; no font files. kb and fallback metrics measured from Fontsource 5.3.0 with Capsize. scripts/check-type.mjs holds the rules and prints the body hash. Co-Authored-By: Claude Opus 5.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.
src/data/type.tsis now the source for the house font set and the twelve pairings from the type guide (§1). It holds data only, and no font files are committed: a site installs the Fontsource package and self-hosts the Latin subset. The file is framework-free. Its header names the downstream copy (portalsrc/brand/type.data.ts; the site vendors it for/type/and/styles/) and carries the pin rule.scripts/check-type.mjsis added to thenpm run checkchain, and the README gets a "Type" section after "Style boards".Body SHA-256:
ea17c3d410b4bd9c16fa5a86368698094de4ed7bfec64315caced3e18279bfafFamilies (16)
Licences were verified three ways: the package's own
LICENSEat 5.3.0 (thelicenceUrl, fetched and matched), the package'slicensefield, andapi.fontsource.org/v1/fonts/<id>.kbis the Latin upright woff2 as Fontsource 5.3.0 ships it (thewghtfile from the defaultindex.cssfor variable families; the listed weights for static ones), measured from the unpacked npm tarballs in KB of 1024 bytes.@fontsource-variable/inter@fontsource-variable/source-sans-3@fontsource-variable/nunito-sans@fontsource-variable/jost@fontsource-variable/jetbrains-mono@fontsource-variable/source-serif-4@fontsource-variable/lora@fontsource-variable/playfair-display@fontsource-variable/fraunces@fontsource-variable/eb-garamond@fontsource-variable/nunito@fontsource/comic-neue(static, 700 only)@fontsource-variable/roboto-slab@fontsource-variable/archivo@fontsource-variable/dancing-scriptfamilyFor(key)returns the first family of a class. Each of the elevenFontKeys resolves, andsystemresolves to System UI, which is how the boards have always drawn it.How the metrics were computed.
@capsizecss/unpack4.0.1 measured each web font from the Fontsource woff2 itself: units per em, ascent, descent, line gap and xWidthAvg. The fallback's numbers come from@capsizecss/metrics4.3.0 (Arial for sans, Times New Roman for serif, Courier New for mono).@capsizecss/core4.1.3createFontStackthen gavesize-adjustand the ascent, descent and line-gap overrides. This is the same method fontaine uses. Values are rounded to two decimals. The metrics are for a fallback@font-facewhosesrcislocal()of the first face infallback, and the check requires that face to be one of those three. Cross-checked against Capsize's published Google Fonts metrics: vertical metrics agree for every family. Average widths differ slightly for a few families, because this PR measures the exact Latinwghtfile a site loads.Pairings (12)
Each board is served by at least one pairing. A pairing may list a board only if its heading and body families match the board's classes, plus the label class where the board has one. The check enforces this, so each board's
type.notestays true of its pairings.All twelve are within the 120 KB budget. The heaviest are precise and workshop, because each loads a third face as its label.
What
check-type.mjsholdsFontKeyresolves. The file's written-outFontKeyandStyleIdunions must equal styles.ts.TYPE_FAMILY_IDS/TYPE_PAIRING_IDS. There are exactly twelve pairings, and "system" costs 0 KB.@fontsource-variable/*and a static one from@fontsource/*. The licence URL is https and names the package. Each family has 1–4 ascending weights and percent metrics.Where this departs from the note's shape
TypeFamily.sourceis"fontsource" | "system".package,licenceandlicenceUrlarenullonly forsystem-ui, and the check enforces that.metrics.lineGapOverride(always0%) is added. So areTYPE_BUDGET_KB,TYPE_FAMILY_IDS/TYPE_PAIRING_IDS, and the helpersisFamilyId,familyById,cssFamily("Inter Variable"),pairingFamiliesandpairingKb.kbcounts upright files only. An italic is a separate file that loads only when a page uses it.Faces excluded, and why
FONT_STACKSname (Avenir Next, Futura, Century Gothic, Didot, Bodoni 72, Palatino, Rockwell, Snell Roundhand, Comic Sans MS). These are OS-bundled or commercial, so they cannot be redistributed. Jost, Playfair Display, Fraunces / EB Garamond, Roboto Slab, Dancing Script and Comic Neue stand in for them.Note
This does not depend on
claude/palettes-data(#31) and touches none of its files. Both PRs append to thecheckchain inpackage.jsonand add a README section after "Style boards", so whichever merges second has a trivial conflict in those two spots.npm run checkis green.🤖 Generated with Claude Code