diff --git a/.changeset/pink-plants-develop.md b/.changeset/pink-plants-develop.md deleted file mode 100644 index f69fb727..00000000 --- a/.changeset/pink-plants-develop.md +++ /dev/null @@ -1,51 +0,0 @@ ---- -'@capsizecss/core': minor -'@capsizecss/metrics': minor -'@capsizecss/unpack': minor ---- - -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. - -```diff - { - "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: - -```ts -const { fontFamily, fontFaces } = createFontStack( - [lobster, arial], - { - subset: 'thai', - }, -); -``` \ No newline at end of file diff --git a/packages/core/CHANGELOG.md b/packages/core/CHANGELOG.md index 4b0ec561..b78ab50b 100644 --- a/packages/core/CHANGELOG.md +++ b/packages/core/CHANGELOG.md @@ -1,5 +1,51 @@ # @capsizecss/core +## 4.1.0 + +### Minor Changes + +- [#177](https://github.com/seek-oss/capsize/pull/177) [`879208b`](https://github.com/seek-oss/capsize/commit/879208bd08372be246ecd30a1be42f44883ca650) Thanks [@michaeltaranto](https://github.com/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. + + ```diff + { + "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: + + ```ts + const { fontFamily, fontFaces } = createFontStack([lobster, arial], { + subset: 'thai', + }); + ``` + ## 4.0.0 ### Major Changes diff --git a/packages/core/package.json b/packages/core/package.json index e2f34956..4a0262a8 100644 --- a/packages/core/package.json +++ b/packages/core/package.json @@ -1,6 +1,6 @@ { "name": "@capsizecss/core", - "version": "4.0.0", + "version": "4.1.0", "description": "Flipping how we define typography", "keywords": [ "capsize", diff --git a/packages/metrics/CHANGELOG.md b/packages/metrics/CHANGELOG.md index 400be4da..1bf8e712 100644 --- a/packages/metrics/CHANGELOG.md +++ b/packages/metrics/CHANGELOG.md @@ -1,5 +1,51 @@ # @capsizecss/metrics +## 2.2.0 + +### Minor Changes + +- [#177](https://github.com/seek-oss/capsize/pull/177) [`879208b`](https://github.com/seek-oss/capsize/commit/879208bd08372be246ecd30a1be42f44883ca650) Thanks [@michaeltaranto](https://github.com/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. + + ```diff + { + "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: + + ```ts + const { fontFamily, fontFaces } = createFontStack([lobster, arial], { + subset: 'thai', + }); + ``` + ## 2.1.1 ### Patch Changes diff --git a/packages/metrics/package.json b/packages/metrics/package.json index 6a8fe4ab..0571690e 100644 --- a/packages/metrics/package.json +++ b/packages/metrics/package.json @@ -1,6 +1,6 @@ { "name": "@capsizecss/metrics", - "version": "2.1.1", + "version": "2.2.0", "description": "Font metrics library for system and Google fonts", "keywords": [ "capsize", @@ -64,7 +64,7 @@ "generate": "pnpm clean && tsx ./scripts/generate.ts" }, "devDependencies": { - "@capsizecss/unpack": "^2.0.1", + "@capsizecss/unpack": "^2.1.0", "@types/cli-progress": "^3.9.2", "@types/node-fetch": "^2.6.2", "cli-progress": "^3.9.1", diff --git a/packages/unpack/CHANGELOG.md b/packages/unpack/CHANGELOG.md index 5aeff208..09e7afda 100644 --- a/packages/unpack/CHANGELOG.md +++ b/packages/unpack/CHANGELOG.md @@ -1,5 +1,51 @@ # @capsizecss/unpack +## 2.1.0 + +### Minor Changes + +- [#177](https://github.com/seek-oss/capsize/pull/177) [`879208b`](https://github.com/seek-oss/capsize/commit/879208bd08372be246ecd30a1be42f44883ca650) Thanks [@michaeltaranto](https://github.com/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. + + ```diff + { + "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: + + ```ts + const { fontFamily, fontFaces } = createFontStack([lobster, arial], { + subset: 'thai', + }); + ``` + ## 2.0.1 ### Patch Changes diff --git a/packages/unpack/package.json b/packages/unpack/package.json index b573a0d1..3b45da7a 100644 --- a/packages/unpack/package.json +++ b/packages/unpack/package.json @@ -1,6 +1,6 @@ { "name": "@capsizecss/unpack", - "version": "2.0.1", + "version": "2.1.0", "description": "Unpack capsize font metrics from fonts", "keywords": [ "capsize", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index e788c593..b0a5d2f8 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -85,7 +85,7 @@ importers: packages/metrics: devDependencies: '@capsizecss/unpack': - specifier: ^2.0.1 + specifier: ^2.1.0 version: link:../unpack '@types/cli-progress': specifier: ^3.9.2 @@ -165,13 +165,13 @@ importers: site: dependencies: '@capsizecss/core': - specifier: ^4.0.0 + specifier: ^4.1.0 version: link:../packages/core '@capsizecss/metrics': - specifier: ^2.1.1 + specifier: ^2.2.0 version: link:../packages/metrics '@capsizecss/unpack': - specifier: ^2.0.1 + specifier: ^2.1.0 version: link:../packages/unpack '@chakra-ui/icons': specifier: ^2.1.1 diff --git a/site/package.json b/site/package.json index 0a4ce794..44b15d25 100644 --- a/site/package.json +++ b/site/package.json @@ -23,9 +23,9 @@ "directory": "site" }, "dependencies": { - "@capsizecss/core": "^4.0.0", - "@capsizecss/metrics": "^2.1.1", - "@capsizecss/unpack": "^2.0.1", + "@capsizecss/core": "^4.1.0", + "@capsizecss/metrics": "^2.2.0", + "@capsizecss/unpack": "^2.1.0", "@chakra-ui/icons": "^2.1.1", "@chakra-ui/react": "^2.8.2", "@emotion/react": "^11.11.3",