diff --git a/.changeset/curvy-forks-brush.md b/.changeset/curvy-forks-brush.md new file mode 100644 index 0000000..2f44618 --- /dev/null +++ b/.changeset/curvy-forks-brush.md @@ -0,0 +1,10 @@ +--- +'@capsizecss/metrics': patch +--- + +metrics: Update apple system font metrics + +Previously the metrics provided for `-apple-system` and `BlinkMacSystemFont` were extracted from the `SF Pro` font, with a custom override to correct the `descent` metric. + +Through work to support metrics for different font weights and styles, it was identified that MacOS uses the `SFNS` font. +Extracting the metrics from this font means no more custom overrides, and will now enable using this font as a fallback via postscript name soon too. diff --git a/packages/metrics/scripts/source-data/systemFontsData.ts b/packages/metrics/scripts/source-data/systemFontsData.ts index 79a833f..ac68290 100644 --- a/packages/metrics/scripts/source-data/systemFontsData.ts +++ b/packages/metrics/scripts/source-data/systemFontsData.ts @@ -8,23 +8,20 @@ if (!fontDirectory) { ); } -const sfProBase: Omit = { +const sfNSBase: Omit = { category: 'sans-serif', files: { - regular: `${fontDirectory}/SF Pro.ttf`, - }, - overrides: { - descent: -420, + regular: `${fontDirectory}/SFNS.ttf`, }, } as const; const systemFonts: FontSourceList = [ { - ...sfProBase, + ...sfNSBase, family: '-apple-system', }, { - ...sfProBase, + ...sfNSBase, family: 'BlinkMacSystemFont', }, { diff --git a/packages/metrics/scripts/systemFonts.json b/packages/metrics/scripts/systemFonts.json index 0bb815b..d23111e 100644 --- a/packages/metrics/scripts/systemFonts.json +++ b/packages/metrics/scripts/systemFonts.json @@ -2,8 +2,8 @@ { "familyName": "-apple-system", "capHeight": 1443, - "ascent": 1950, - "descent": -420, + "ascent": 1980, + "descent": -432, "lineGap": 0, "unitsPerEm": 2048, "xHeight": 1040, @@ -40,8 +40,8 @@ { "familyName": "BlinkMacSystemFont", "capHeight": 1443, - "ascent": 1950, - "descent": -420, + "ascent": 1980, + "descent": -432, "lineGap": 0, "unitsPerEm": 2048, "xHeight": 1040,