Packages

@capsizecss/metrics

4.5.0 · 17 Nov 2026MIT472.5k / weekRepositorynpmAtom feed

Your version

30 stable releases, newest first, by release line. Notes are quoted as the maintainers published them.

  1. 4.x · latest line
  2. 4.5.0

    17 Nov 2026
    • Update Google Fonts — November 2026

    • Agrave Pro

    • Firjar

  3. 4.4.0

    15 Oct 2026
    • Update Google Fonts — October 2026

    • Clarity City

    • Isometra

  4. 4.3.0

    15 Sep 2026
    • Update Google Fonts — September 2026

    • Asap Sharp

    • Caacupe One

  5. 4.2.0

    20 Jul 2026
    • Update Google Fonts — July 2026

    • Geist Pixel

    • Geomini

  6. 4.1.0

    15 Jun 2026
    • Update Google Fonts — June 2026

    • Alien Block

    • Pliant

  7. 4.0.0

    18 May 2026
    • Breaking

      Update Google Fonts — May 2026

      BREAKING CHANGE: 2 fonts were removed due to no longer being available in the Google Fonts library (see list below).

  8. 3.x
  9. 3.7.0

    17 Mar 2026
    • Update Google Fonts

  10. 3.6.2

    13 Nov 2025
    • metrics: Fix font metric types

  11. 3.6.1

    12 Nov 2025
    • Bundle Capsize packages with tsdown instead of Crackle. This is an internal change only and does not affect the public API.

  12. 3.6.0

    6 Nov 2025
    • Update Google Fonts

  13. 3.5.0

    31 Mar 2025
    • Update Google Fonts

  14. 3.4.0

    13 Nov 2024
    • Update Google Fonts

  15. 3.3.0

    15 Sep 2024
    • Update Google Fonts to latest

  16. 3.2.0

    23 May 2024
    • 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%"
      //       }
      //     }
      //   ]
      // }
  17. 3.1.0

    5 May 2024
    • 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”.

      @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%;
      }
  18. 3.0.0

    15 Apr 2024
    • Breaking

      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).

    • Update Google Fonts to latest

    • 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.

  19. 2.x
  20. 2.2.0

    8 Mar 2024
    • 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.

  21. 2.1.1

    5 Mar 2024
    • xWidthAvg: Improve metric by factoring in space to weightings

      Analyzing the xWidthAvg metrics for latin character sets, we have seen further improvement in the accuracy by factoring in the space character to the weightings.

  22. 2.1.0

    27 Feb 2024
    • metrics: Provide ESM entrypoints for individual font metrics

      Build an ESM version of individual font metrics in preparation for adding named exports as part of the upcoming support for non-latin unicode subsets.

  23. 2.0.0

    16 Feb 2024
    • Breaking

      Precompile Capsize packages with [Crackle]

      Migrating Capsize packages to be precompiled with [Crackle], with a key change being Crackle now handles entry points instead of [Preconstruct].

      Other benefits include:

    • xWidthAvg: Update character frequency weightings data source

      The character frequency weightings used to calculate the xWidthAvg metrics were previously hard coded internally, and were an adaption from a [frequency table] from Wikipedia.

      We now generate these weightings based on the abstracts from [WikiNews] articles.
      This makes it possible to add support for languages that use non-latin [unicode subsets], e.g. Thai, by adding the relevant abstract and generating the xAvgWidth based on the corresponding unicode subset range.

  24. 1.x
  25. 1.3.0

    1 Jan 2024
    • Update Google Fonts to latest

    • entireMetricsCollection: Sort metrics by familyName

      Sort the metrics collection by familyName. Provides a nicer experience by default when looping over the dataset, while also improving the review DX when adding/editing metrics.

  26. 1.2.0

    7 Jun 2023
    • Update Google Fonts to latest

  27. 1.1.1

    25 Feb 2023
    • Ensure metrics files are published to npm

  28. 1.1.0

    19 Feb 2023
    • fontFamilyToCamelCase: Expose utility to convert family name to import name

      A helper function to support tooling that needs to convert the font family name to the correct casing for the relevant metrics import.

      import { fontFamilyToCamelCase } from '@capsizecss/metrics';
      
      const familyName = fontFamilyToCamelCase('--apple-system'); // => `appleSystem`
      const metrics = await import(`@capsizecss/metrics/${familyName}`);
    • entireMetricsCollection: Expose all metrics indexed by family name

      Provides the entire metrics collection as a JSON object, keyed by font family name.


      ⚠️ CAUTION: Importing this will result in a large JSON structure being pulled into your project!

      It is not recommended to use this client side.


      import { entireMetricsCollection } from '@capsizecss/metrics/entireMetricsCollection';
      
      const metrics = entireMetricsCollection['arial'];
  29. 1.0.1

    1 Feb 2023
    • oxygen: Refine missing metrics

      Refines the missing capHeight and xHeight metrics to align with anchor co-ordinates of relevant glyphs — H for capHeight and x for xHeight. Previously these values where subjectively observed using the Capsize website.

    • Add more system fonts

      Expands the metrics library to include more system fonts. Fonts added are:

      The library now support all the Best Web Safe Fonts.

  30. 1.0.0

    31 Jan 2023
    • Breaking

      Metrics, unpack: Cut v1 release

      No actual breaking change here, but cutting the v1 release to mark the packages moving out of experimental phase.

    • Update Google Fonts

    • Calculate and expose xWidthAvg, the average width of lowercase characters.

  31. 0.4.x
  32. 0.4.0

    11 Nov 2022
    • Update Google Fonts to latest

    • Add timesNewRoman metrics

      Provides metrics for the built in system font Times New Roman.
      Can be used by importing as @capsizecss/metrics/timesNewRoman.

  33. 0.3.x
  34. 0.3.0

    11 Jul 2022
    • Update Google Fonts to latest

  35. 0.2.x
  36. 0.2.0

    23 Mar 2022
    • Expose xHeight metadata when available

    • metrics: Ensure generated types reflect extracted metadata

      The constructed types will now align with the metadata available from the font itself. This will ensure that TypeScript consumers receieve build time feedback for incomplete metrics, allowing manual overrides to complete the required FontMetric data.

    • metrics: Update Google Fonts to latest

  37. 0.1.x
  38. 0.1.0

    24 Sep 2021
    • Initial release

A whole project to check? Paste its package.json in the dependency check: every deprecated, outdated or vulnerable dependency, with what to upgrade to. Free, no account.