Releases: seek-oss/capsize
@capsizecss/[email protected]
Minor Changes
-
#177
879208b
Thanks @michaeltaranto! - xWidthAvg: Addsubset
support for non-latin character setsPreviously the
xWidthAvg
metric was calculated based on the character frequency as measured from English text only.
This resulted in thexWidthAvg
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 thexWidthAvg
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 acceptssubset
as an option:const { fontFamily, fontFaces } = createFontStack([lobster, arial], { subset: 'thai', });
@capsizecss/[email protected]
Minor Changes
-
#177
879208b
Thanks @michaeltaranto! - xWidthAvg: Addsubset
support for non-latin character setsPreviously the
xWidthAvg
metric was calculated based on the character frequency as measured from English text only.
This resulted in thexWidthAvg
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 thexWidthAvg
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 acceptssubset
as an option:const { fontFamily, fontFaces } = createFontStack([lobster, arial], { subset: 'thai', });
@capsizecss/[email protected]
Patch Changes
-
#181
c2091af
Thanks @michaeltaranto! - xWidthAvg: Improve metric by factoring in space to weightingsAnalyzing the
xWidthAvg
metrics forlatin
character sets, we have seen further improvement in the accuracy by factoring in the space character to the weightings.
@capsizecss/[email protected]
Patch Changes
-
#181
c2091af
Thanks @michaeltaranto! - xWidthAvg: Improve metric by factoring in space to weightingsAnalyzing the
xWidthAvg
metrics forlatin
character sets, we have seen further improvement in the accuracy by factoring in the space character to the weightings.
@capsizecss/[email protected]
Minor Changes
-
#175
f2e1c2f
Thanks @michaeltaranto! - metrics: Provide ESM entrypoints for individual font metricsBuild 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]
Major Changes
-
#168
8819ff1
Thanks @mrm007! - Precompile Capsize packages with CrackleMigrating 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 — eithernode16
,nodenext
orbundler
. This will ensure types are correctly resolved across the different module specifications. -
#171
e73da2d
Thanks @michaeltaranto! - Drop support for Vanilla Extract below v1.4Upgrading 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]
Major Changes
-
#168
8819ff1
Thanks @mrm007! - Precompile Capsize packages with CrackleMigrating 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 — eithernode16
,nodenext
orbundler
. This will ensure types are correctly resolved across the different module specifications.
@capsizecss/[email protected]
Major Changes
-
#168
8819ff1
Thanks @mrm007! - Precompile Capsize packages with CrackleMigrating 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 — eithernode16
,nodenext
orbundler
. This will ensure types are correctly resolved across the different module specifications.
Minor Changes
-
#167
193d5ec
Thanks @michaeltaranto! - xWidthAvg: Update character frequency weightings data sourceThe 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 thexAvgWidth
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]
Major Changes
-
#168
8819ff1
Thanks @mrm007! - Precompile Capsize packages with CrackleMigrating 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 — eithernode16
,nodenext
orbundler
. 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 stackThe
fontFamily
returned fromcreateFontStack
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: Quotefont-family
in@font-face
declaration if neededPreviously, 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.