made-in-common

fontaine

Automatic font fallback based on font metrics

by made-in-common

TypeScript

TypeScript90.6%
Vue6.2%
CSS1.5%
HTML0.8%
JavaScript0.6%
Svelte0.3%

Commit activity

Last 12 weeks · 126 commits

Full graph →

Community health

3 of 6 standards met

Community profile →
50
✓README✓License○Contributing✓Code of Conduct○Issue Template○PR Template

Recent PRs & issues

Active · 1 in progress · Last activity 18h ago
See all on GitHub →
divine

🐛 The bug fontless 1.3.4 (via @nuxt/fonts 1.2.0) With Tailwind's default sans stack plus Inter in front: the generated stack is: Apple Color Emoji has glyphs for the space and the digits, so until Inter loads, macOS and iOS render word spaces and numbers from it: very wide gaps between words, spread-out numbers, then a layout shift when Inter swaps in. With the fallbacks were . Emoji families are already in systemFontFamilies; they should be skipped when picking metric fallbacks. Workaround: 🛠️ To reproduce 🌈 Expected behaviour ℹ️ Additional context _No response_

divine · 6h ago
Ice-Hazymoon

re-parses every node to find nested rules. css-tree also keeps custom property values as , so on a stylesheet with many declarations nearly all of that work is parsing values like or , which can never contain a rule. This skips nodes that have no . On our UnoCSS output in dev (~3.4 MB, 4858 nodes, nearly all custom property values), goes from ~810 ms to ~157 ms per call. The sheet is regenerated many times during a cold page load, so this was most of the CPU time of our first page load in dev. The new test counts calls for custom property values and checks that / in nested rules, and nested custom properties with , are still handled. Summary by CodeRabbit Bug Fixes** Improved handling of nested CSS so custom property values without nested rules are preserved, while nested font declarations continue to be processed correctly. Brace-containing values without nested rules remain unchanged. Nested and declarations are processed correctly. Nested custom properties are also handled correctly when font-prefixed-only variable processing is enabled.

Ice-Hazymoon · 1d ago
danielroe

when a site uses one variable family for body text, bold headings and wide labels, only matches the regular weight. Everything else reflows when the web font loads. each system font gets a single face, with no or and one set of metrics: there are two contributors to the layout shift. 1. bold text is drawn with the regular system face (synthetic bold keeps the regular advance widths) 2. ... and then the is only right for the regular weight at normal width. so this PR gives a variable font a second face per system font, matched by . It points at the system font's own bold face and is sized to the bold weight of the web font. users can also list the weights and widths their site uses, on a family or on for every family: here's the width of text in Archivo divided by its width in the Helvetica Neue face, measured in Chromium: and against Arial [!NOTE] the metrics ships grow from 363 kB to 447 kB, for the width and names of each family's bold face. will pick this up through and . Capitals are still about 2% out, because one per face can't fit both cases. Summary by CodeRabbit New Features Variable fonts can generate additional fallback faces for configured weight and stretch instances, with width-adjusted metrics when available. Configure fallback instances per font family or set defaults. An empty list disables additional instances, and instances outside a font face’s declared ranges are skipped. Bold fallback faces use bold-specific metrics and local font names when available. When width measurements aren’t available, unsupported instances are skipped. Documentation Added guidance on variable-font fallback behavior, supported ranges, and width measurement requirements.

danielroe · 1d ago
Structured data for AI agents

Repository: made-in-common/fontaine. Description: Automatic font fallback based on font metrics Stars: 2020, Forks: 50. Primary language: TypeScript. Languages: TypeScript (90.6%), Vue (6.2%), CSS (1.5%), HTML (0.8%), JavaScript (0.6%). License: MIT. Topics: cls, fonts, hacktoberfest, web-vitals. Latest release: release-2026-11-25 (1d ago). Open PRs: 1, open issues: 9. Last activity: 18h ago. Community health: 50%. Top contributors: renovate[bot], danielroe, hi-ogawa, github-actions[bot], onmax, gioboa, johnnyreilly, michaeltaranto, qwerzl, iiio2 and others.