seek-oss / capsize

Flipping how we define typography in CSS.
https://seek-oss.github.io/capsize/
MIT License
1.48k stars 37 forks source link

createFontStack: Prefer `postscriptName` or `fullName` for fallback src #200

Closed michaeltaranto closed 2 months ago

michaeltaranto commented 2 months ago

The @font-face declaration aliases generated by createFontStack now favour postscriptName and fullName over familyName from the provided metrics when selecting a local font face as a fallback.

MDN recommends using either fullName and postscriptName when accessing local fonts to ensure the best matching across platforms, while also enabling selection of a single font face within a larger family, e.g. Arial Bold or Arial-BoldMT within Arial. For details see MDN.

⚠️ Note: Falling back to familyName (original behaviour) makes this work backwards compatible with older versions of font metrics.

changeset-bot[bot] commented 2 months ago

🦋 Changeset detected

Latest commit: 276594377f5cb1457e533817d4a2bef2c439d32b

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package | Name | Type | | ---------------- | ----- | | @capsizecss/core | Patch |

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR