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

Update dependency @capsizecss/metrics to v3 #2626

Merged
merged 1 commit into from
Sep 16, 2024

Conversation

renovate[bot]
Copy link
Contributor

@renovate renovate bot commented Sep 16, 2024

This PR contains the following updates:

Package Change Age Adoption Passing Confidence
@capsizecss/metrics (source) 3.2.0 -> 3.3.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 - At any time (no schedule defined).

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

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.


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

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

Copy link
Contributor Author

renovate bot commented Sep 16, 2024

⚠️ Artifact update problem

Renovate failed to update an artifact related to this branch. You probably do not want to merge this PR as-is.

♻ Renovate will retry this branch, including artifacts, only when one of the following happens:

  • any of the package files in this branch needs updating, or
  • the branch becomes conflicted, or
  • you click the rebase/retry checkbox if found above, or
  • you rename this PR's title to start with "rebase!" to trigger it manually

The artifact failure details are included below:

File name: pnpm-lock.yaml
Scope: all 21 workspace projects
Progress: resolved 1, reused 0, downloaded 0, added 0
bench/vercel                             |  WARN  deprecated term-size@4.0.0
.                                        |  WARN  deprecated @babel/plugin-proposal-object-rest-spread@7.20.7
.                                        |  WARN  deprecated @types/sharp@0.32.0
/tmp/renovate/repos/github/X-oss-byte/Nextjs/packages/next-swc/crates/next-dev-tests/tests:
 ERR_PNPM_FETCH_404  GET https://registry.npmjs.org/@turbo%2Fpack-test-harness: Not Found - 404

This error happened while installing a direct dependency of /tmp/renovate/repos/github/X-oss-byte/Nextjs/packages/next-swc/crates/next-dev-tests/tests

@turbo/pack-test-harness is not in the npm registry, or you have no permission to fetch it.

No authorization header was set for the request.

Copy link

stackblitz bot commented Sep 16, 2024

Review PR in StackBlitz Codeflow Run & review this pull request in StackBlitz Codeflow.

Copy link

changeset-bot bot commented Sep 16, 2024

⚠️ No Changeset found

Latest commit: 487aaa1

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

Click here to learn what changesets are, and how to add one.

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

@kodiakhq kodiakhq bot merged commit fc8de85 into canary Sep 16, 2024
1 of 2 checks passed
@kodiakhq kodiakhq bot deleted the renovate/capsizecss-metrics-3.x branch September 16, 2024 01:11
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.

0 participants