Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore(deps): update dependency @capsizecss/metrics to v3 #346

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

renovate[bot]
Copy link
Contributor

@renovate renovate bot commented Jun 5, 2024

This PR contains the following updates:

Package Change Age Adoption Passing Confidence
@capsizecss/metrics (source) ^2.1.1 -> ^3.0.0 age adoption passing confidence

Release Notes

seek-oss/capsize (@​capsizecss/metrics)

v3.3.0

Compare Source

Minor Changes

v3.2.0

Compare Source

Minor Changes
  • #​202 452f2a3 Thanks @​michaeltaranto! - metrics: Add weight and italic support

    Add support for importing metrics for specific weights and italics.
    While internal font metrics typically do not differ between variants, the xWidthAvg metric is calculated based on the average character width, and this will differ between variants.

    Available variants will differ by font, and follow the same variant naming as Google Fonts:

    import arial from '@​capsizecss/metrics/arial';
    import arialItalic from '@​capsizecss/metrics/arial/italic';
    import arialBold from '@​capsizecss/metrics/arial/700';
    import arialBoldItalic from '@​capsizecss/metrics/arial/700italic';

    Having metrics for different variants improves visual alignment of fallback fonts when using the createFontStack API from the @capsizecss/core package.

    Example usage:

    import { createFontStack } from '@​capsizecss/core';
    import montserrat from '@​capsizecss/metrics/montserrat';
    import montserrat600 from '@​capsizecss/metrics/montserrat/600';
    import arial from '@​capsizecss/metrics/arial';
    import arialBold from '@​capsizecss/metrics/arial/700';
    
    const regular = createFontStack([montserrat, arial]);
    
    // => {
    //   "fontFamily": "Montserrat, \"Montserrat Fallback\", Arial",
    //   "fontFaces": [
    //     {
    //       "@​font-face": {
    //         "fontFamily": "\"Montserrat Fallback\"",
    //         "src": "local('Arial'), local('ArialMT')",
    //         "ascentOverride": "85.7923%",
    //         "descentOverride": "22.2457%",
    //         "lineGapOverride": "0%",
    //         "sizeAdjust": "112.8307%"
    //       }
    //     }
    //   ]
    // }
    
    const bold = createFontStack([montserrat600, arialBold], {
      fontFaceProperties: {
        fontWeight: 700,
      },
    });
    
    // => {
    //   "fontFamily": "Montserrat, \"Montserrat Fallback\", Arial",
    //   "fontFaces": [
    //     {
    //       "@​font-face": {
    //         "fontWeight": 700,
    //         "fontFamily": "\"Montserrat Fallback\"",
    //         "src": "local('Arial Bold'), local('Arial-BoldMT')",
    //         "ascentOverride": "89.3502%",
    //         "descentOverride": "23.1683%",
    //         "lineGapOverride": "0%",
    //         "sizeAdjust": "108.3377%"
    //       }
    //     }
    //   ]
    // }

v3.1.0

Compare Source

Minor Changes
  • #​195 aa77cb2 Thanks @​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:

    // 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(<font-face-name>) sources.
    MDN recommends using both “to assure proper matching across platforms”.

    @&#8203;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%;
    }

v3.0.0

Compare Source

Major Changes
  • #​191 d0086a6 Thanks @​michaeltaranto! - metrics: Prefer public family name to internal familyName metrics

    Ensure metrics are available using the public family name as seen on Google Fonts as opposed to the internal family name metric.
    This makes sense as consumers are looking to import the metrics relevant to a specific system font or from Google Fonts (also aligns with the names Google use in their font declarations generated in the hosted stylesheets).

BREAKING CHANGES:
Google Fonts

Previously, the metrics were imported with a path that used the internal family name, now they align with the font as seen on Google Fonts.

-import metrics from '@&#8203;capsizecss/metrics/roundedMplus1c';
+import metrics from '@&#8203;capsizecss/metrics/mPLUSRounded1c';

With only a small number of Google Fonts affected, this is only a break for the following fonts:

  • Ballet
  • Bodoni Moda
  • Buda
  • Bungee Spice
  • Fjord One
  • Geologica
  • Imbue
  • M PLUS Rounded 1c
  • Material Symbols Outlined
  • Material Symbols Rounded
  • Material Symbols Sharp
  • Montagu Slab
  • Nanum Pen Script
  • Newsreader
  • Nunito Sans
  • Pathway Extreme
  • Sono
  • Sunflower
  • Supermercado One
  • Texturina
System fonts

The system fonts only had one example where the names diverged:

-import metrics from '@&#8203;capsizecss/metrics/brushScriptMT';
+import metrics from '@&#8203;capsizecss/metrics/brushScript';

This now aligns with the name consumers use to reference the font on their system.

Minor Changes
Patch Changes
  • #​193 121eb42 Thanks @​michaeltaranto! - 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.


Configuration

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

🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.

Rebasing: Whenever PR is behind base branch, or you tick the rebase/retry checkbox.

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


  • If you want to rebase/retry this PR, check this box

This PR was generated by Mend Renovate. View the repository job log.

@renovate renovate bot force-pushed the renovate/capsizecss-metrics-3.x branch 2 times, most recently from c388ddb to 7cc8dae Compare June 10, 2024 09:13
@renovate renovate bot force-pushed the renovate/capsizecss-metrics-3.x branch 2 times, most recently from 129b79c to 4646de2 Compare June 24, 2024 04:54
@renovate renovate bot force-pushed the renovate/capsizecss-metrics-3.x branch 5 times, most recently from 818d266 to 2f81315 Compare July 11, 2024 20:27
@renovate renovate bot force-pushed the renovate/capsizecss-metrics-3.x branch 4 times, most recently from 86d272a to 973cb88 Compare July 22, 2024 06:09
@renovate renovate bot force-pushed the renovate/capsizecss-metrics-3.x branch 2 times, most recently from 3b35fe3 to 7d18455 Compare August 5, 2024 04:12
@renovate renovate bot force-pushed the renovate/capsizecss-metrics-3.x branch 2 times, most recently from 0b6c963 to 5aa4db2 Compare August 19, 2024 05:42
@renovate renovate bot force-pushed the renovate/capsizecss-metrics-3.x branch 2 times, most recently from 25fb593 to 2668f7c Compare August 28, 2024 07:40
@renovate renovate bot force-pushed the renovate/capsizecss-metrics-3.x branch 3 times, most recently from 6c45017 to 53d452d Compare September 9, 2024 08:04
@renovate renovate bot force-pushed the renovate/capsizecss-metrics-3.x branch from 53d452d to 01491fe Compare September 16, 2024 03:33
@renovate renovate bot force-pushed the renovate/capsizecss-metrics-3.x branch from 01491fe to 589000b Compare September 16, 2024 07:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

0 participants