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
fix: correctly generate numeric unicode subset faces [#949] #961
Conversation
🦋 Changeset detectedLatest commit: eb239d6 The changes in this PR will be included in the next version bump. This PR includes changesets to release 2 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think everything looks good. This shouldn't be breaking, right?
# Conflicts: # packages/cli/tests/sass/mixins.test.ts
I do not consider this a breaking change but there is some impact. |
Widening the subset range is fine since users won't necessarily download the extra font files unless their webpage uses unicode characters outside the latin subset. Thank you very much for your contribution! I think it looks good to me! 🎉 |
Template from
packages/cli/src/sass/mixins.ts
file make use of themetada
file generated bypackages/cli/src/sass/metada.ts
. In thismetada
file, each subset of a font is represented by a unicode subset defined by a unicode range but sometime, the main font subset can be represented by numeric subsets.When calling the mixin function with this
main
subset specified as parameter, there is an issue where the mixin function tries to verify that thismain
subset is equal to thedefault
subset. But this is rarely the case because most of the time thedefault
subset is almost always set tolatin
, so it fails to produce the expected output.Change made in
packages/cli/src/sass/mixins.ts
check that if the the subset value passed as parameter does not have a unicode subset but is part of the list of the font subsets then we use the numeric unicode subsets.Test case was update to be able to pass options to the mixin call and catch this case as well.
side note: indentation of some files were also modified but it does not seem like an error since they seem to be aligned with the content of the editorconfig file.