unjs / fontaine

Automatic font fallback based on font metrics
MIT License
1.47k stars 23 forks source link

chore(deps): update dependency @capsizecss/unpack to v2.2.0 #348

Closed renovate[bot] closed 1 month ago

renovate[bot] commented 1 month ago

Mend Renovate

This PR contains the following updates:

Package Change Age Adoption Passing Confidence
@capsizecss/unpack (source) 2.0.1 -> 2.2.0 age adoption passing confidence

Release Notes

seek-oss/capsize (@​capsizecss/unpack) ### [`v2.2.0`](https://togithub.com/seek-oss/capsize/blob/HEAD/packages/unpack/CHANGELOG.md#220) [Compare Source](https://togithub.com/seek-oss/capsize/compare/@capsizecss/unpack@2.1.0...@capsizecss/unpack@2.2.0) ##### Minor Changes - [#​195](https://togithub.com/seek-oss/capsize/pull/195) [`aa77cb2`](https://togithub.com/seek-oss/capsize/commit/aa77cb2b58f1fa9de9bd01e6933b6ad838ba325c) Thanks [@​michaeltaranto](https://togithub.com/michaeltaranto)! - Extract and expose `postscriptName` and `fullName` from font metrics The font metrics returned now include the `postscriptName` and `fullName` properties as authored by the font creator. For example: ```ts // Arial Regular metrics { "familyName": "Arial", "fullName": "Arial", "postscriptName": "ArialMT", ... } // Arial Bold metrics { "familyName": "Arial", "fullName": "Arial Bold", "postscriptName": "Arial-BoldMT", ... } ``` These values are particularly useful when constructing CSS `@font-face` declarations, as they can be used to specify [local(\)][local()] sources. MDN recommends using both “to assure proper matching across platforms”. ```css @​font-face { font-family: 'Web Font Fallback'; src: local('Arial Bold'), local('Arial-BoldMT'); font-weight: 700; ascent-override: 89.3502%; descent-override: 23.1683%; size-adjust: 108.3377%; } ``` [local()]: https://developer.mozilla.org/en-US/docs/Web/CSS/@​font-face/src#localfont-face-name ### [`v2.1.0`](https://togithub.com/seek-oss/capsize/blob/HEAD/packages/unpack/CHANGELOG.md#210) [Compare Source](https://togithub.com/seek-oss/capsize/compare/@capsizecss/unpack@2.0.1...@capsizecss/unpack@2.1.0) ##### Minor Changes - [#​177](https://togithub.com/seek-oss/capsize/pull/177) [`879208b`](https://togithub.com/seek-oss/capsize/commit/879208bd08372be246ecd30a1be42f44883ca650) Thanks [@​michaeltaranto](https://togithub.com/michaeltaranto)! - xWidthAvg: Add `subset` support for non-latin character sets Previously the `xWidthAvg` metric was calculated based on the character frequency as measured from English text only. This resulted in the `xWidthAvg` metric being incorrect for languages that use a different unicode subset range, e.g. Thai. Supporting Thai now enables adding support for other unicode ranges in the future. ##### What's changed? ##### `@capsizecss/metrics` The `subsets` field has been added to the metrics object, providing the `xWidthAvg` metric for each subset — calculated against the relevant character frequency data. ```diff { "familyName": "Abril Fatface", ... + "subsets": { + "latin": { + "xWidthAvg": 512 + }, + "thai": { + "xWidthAvg": 200 + } + } } ``` There are no changes to any of the other existing metrics. ##### `@capsizecss/core` Fallback font stacks can now be generated per subset, allowing the correct `xWidthAvg` metric to be used for the relevant subset. The `createFontStack` API now accepts `subset` as an option: ```ts const { fontFamily, fontFaces } = createFontStack([lobster, arial], { subset: 'thai', }); ```

Configuration

📅 Schedule: Branch creation - At any time (no schedule defined), Automerge - "before 4am on Monday" (UTC).

🚦 Automerge: Enabled.

Rebasing: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.

🔕 Ignore: Close this PR and you won't be reminded about this update again.



This PR has been generated by Mend Renovate. View repository job log here.

codecov[bot] commented 1 month ago

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Project coverage is 53.67%. Comparing base (c99ecf4) to head (85fd68c).

Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #348 +/- ## ======================================= Coverage 53.67% 53.67% ======================================= Files 4 4 Lines 367 367 Branches 31 31 ======================================= Hits 197 197 Misses 170 170 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.