Skip to content

Releases: seek-oss/capsize

@capsizecss/[email protected]

08 Mar 10:06
1e6d67f
Compare
Choose a tag to compare

Minor Changes

  • #177 879208b Thanks @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.

     {
       "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:

    const { fontFamily, fontFaces } = createFontStack([lobster, arial], {
      subset: 'thai',
    });

@capsizecss/[email protected]

08 Mar 10:06
1e6d67f
Compare
Choose a tag to compare

Minor Changes

  • #177 879208b Thanks @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.

     {
       "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:

    const { fontFamily, fontFaces } = createFontStack([lobster, arial], {
      subset: 'thai',
    });

@capsizecss/[email protected]

05 Mar 00:59
9ac622e
Compare
Choose a tag to compare

Patch Changes

  • #181 c2091af Thanks @michaeltaranto! - 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.

@capsizecss/[email protected]

05 Mar 00:59
9ac622e
Compare
Choose a tag to compare

Patch Changes

  • #181 c2091af Thanks @michaeltaranto! - 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.

@capsizecss/[email protected]

27 Feb 02:45
4708ae9
Compare
Choose a tag to compare

Minor Changes

  • #175 f2e1c2f Thanks @michaeltaranto! - 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.

@capsizecss/[email protected]

16 Feb 04:37
6a7a7dc
Compare
Choose a tag to compare

Major Changes

  • #168 8819ff1 Thanks @mrm007! - 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:

    • Modern module entry point syntax using the "exports" field with better tooling compatibility.
    • Improved types and better ESM and CJS compatibility
    • Better alignment between compiled code and module entry points

    BREAKING CHANGES:

    API changes

    While technically a breaking change, consumers of Capsize's public APIs are not affected by this change.
    If you are affected due to reaching into package internals, please get in touch and see if we can find a more maintainable approach.

    TypeScript

    TypeScript consumers should ensure they are using a compatible moduleResolution strategy in TSConfig — either node16, nodenext or bundler. This will ensure types are correctly resolved across the different module specifications.

  • #171 e73da2d Thanks @michaeltaranto! - Drop support for Vanilla Extract below v1.4

    Upgrading to use Vanilla Extract's style composition API in favour of the long time deprecated composeStyles function.
    There is no API change for Capsize consumers, but this change will require a peer dependency of [email protected] or greater.

Patch Changes

@capsizecss/[email protected]

16 Feb 04:37
6a7a7dc
Compare
Choose a tag to compare

Major Changes

  • #168 8819ff1 Thanks @mrm007! - 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:

    • Modern module entry point syntax using the "exports" field with better tooling compatibility.
    • Improved types and better ESM and CJS compatibility
    • Better alignment between compiled code and module entry points

    BREAKING CHANGES:

    API changes

    While technically a breaking change, consumers of Capsize's public APIs are not affected by this change.
    If you are affected due to reaching into package internals, please get in touch and see if we can find a more maintainable approach.

    TypeScript

    TypeScript consumers should ensure they are using a compatible moduleResolution strategy in TSConfig — either node16, nodenext or bundler. This will ensure types are correctly resolved across the different module specifications.

@capsizecss/[email protected]

16 Feb 04:37
6a7a7dc
Compare
Choose a tag to compare

Major Changes

  • #168 8819ff1 Thanks @mrm007! - 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:

    • Modern module entry point syntax using the "exports" field with better tooling compatibility.
    • Improved types and better ESM and CJS compatibility
    • Better alignment between compiled code and module entry points

    BREAKING CHANGES:

    API changes

    While technically a breaking change, consumers of Capsize's public APIs are not affected by this change.
    If you are affected due to reaching into package internals, please get in touch and see if we can find a more maintainable approach.

    TypeScript

    TypeScript consumers should ensure they are using a compatible moduleResolution strategy in TSConfig — either node16, nodenext or bundler. This will ensure types are correctly resolved across the different module specifications.

Minor Changes

  • #167 193d5ec Thanks @michaeltaranto! - 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.

    Will this change anything for consumers?

    Given the updated xWidthAvg metrics are very close to the original hard coded values, we do not forsee any impact on consumers.
    Even our CSS snapshot tests were unchanged, and they contain values rounded to 4 decimal places!

    The result is either no or extremely minor changes to the generated fallback font CSS, with the benefit being this lays the ground work to support additional language subsets in the near future.

@capsizecss/[email protected]

16 Feb 04:37
6a7a7dc
Compare
Choose a tag to compare

Major Changes

  • #168 8819ff1 Thanks @mrm007! - 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:

    • Modern module entry point syntax using the "exports" field with better tooling compatibility.
    • Improved types and better ESM and CJS compatibility
    • Better alignment between compiled code and module entry points

    BREAKING CHANGES:

    API changes

    While technically a breaking change, consumers of Capsize's public APIs are not affected by this change.
    If you are affected due to reaching into package internals, please get in touch and see if we can find a more maintainable approach.

    TypeScript

    TypeScript consumers should ensure they are using a compatible moduleResolution strategy in TSConfig — either node16, nodenext or bundler. This will ensure types are correctly resolved across the different module specifications.

Patch Changes

  • #164 a308885 Thanks @michaeltaranto! - createFontStack: Append original fallback font name to the font stack

    The fontFamily returned from createFontStack now includes the original fallback font name(s). These are appended to the end of the font stack in the case the preferred font and generated fallbacks are not available.

    import lobster from '@capsizecss/metrics/lobster';
    import arial from '@capsizecss/metrics/arial';
    
    const { fontFamily } = createFontStack([lobster, arial]);

    Where fontFamily is now:

    - `Lobster, 'Lobster Fallback: Arial'`
    + `Lobster, 'Lobster Fallback: Arial', Arial`
  • #164 a308885 Thanks @michaeltaranto! - createFontStack: Quote font-family in @font-face declaration if needed

    Previously, when using fontFaceFormat: 'styleObject', the generated fallback name was not quoted as necessary within the @font-face declaration.
    This could cause issues if the font family name contained spaces or other characters that required quoting.

@capsizecss/[email protected]

14 Jan 22:42
b9288c9
Compare
Choose a tag to compare

Patch Changes