Skip to content

Conversation

onmax
Copy link
Contributor

@onmax onmax commented Oct 11, 2025

Fixes #544

Automatic font fallback selection based on font categories (serif, sans-serif, monospace). Maintains full backward compatibility.

Changes

  • Auto-selects appropriate fallbacks based on font category
  • Added categoryFallbacks option for customization
  • Extended FontFaceMetrics with optional category field

@onmax onmax requested a review from danielroe as a code owner October 11, 2025 09:41
Copy link

netlify bot commented Oct 11, 2025

Deploy Preview for fontless failed.

Name Link
🔨 Latest commit 985453b
🔍 Latest deploy log https://app.netlify.com/projects/fontless/deploys/68ea3c6d4830b80008196362

Copy link

pkg-pr-new bot commented Oct 11, 2025

Open in StackBlitz

npm i https://pkg.pr.new/fontaine@674
npm i https://pkg.pr.new/fontless@674

commit: 985453b

@onmax onmax force-pushed the feat/category-aware-fallbacks branch from 9af3f73 to 6d0fa33 Compare October 11, 2025 09:51
Copy link

codecov bot commented Oct 11, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 53.08%. Comparing base (d66809d) to head (985453b).

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #674      +/-   ##
==========================================
- Coverage   53.40%   53.08%   -0.32%     
==========================================
  Files          11       11              
  Lines         734      729       -5     
  Branches       93       93              
==========================================
- Hits          392      387       -5     
  Misses        342      342              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Copy link
Member

@danielroe danielroe left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we do something similar in fontless. maybe we could export the shared/overlapping utils or defaults from fontaine so we could share?

onmax added 2 commits October 11, 2025 13:00
fix: typo in test description

fix: lowercase describe block per linter
@onmax onmax force-pushed the feat/category-aware-fallbacks branch from 934c7ec to 985453b Compare October 11, 2025 11:15
@onmax
Copy link
Contributor Author

onmax commented Oct 11, 2025

I think we do something similar in fontless. maybe we could export the shared/overlapping utils or defaults from fontaine so we could share?

Refactored!

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.

different default font fallbacks depending on whether custom web font is serif or sans serif

2 participants