-
-
Notifications
You must be signed in to change notification settings - Fork 167
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
Chinese Noto fonts mixin does not allow using symbolic subsets #949
Comments
I have the same issue trying to generate faces for Noto CJK, it seems related to the following open issues: @if (
($subset == $unicodeSubset) or
(
// Expecting to use numeric subset but since default subset is latin, it will not produce any faces
($subset == map.get($metadata, defaults, subset)) and not
list.index(map.get($metadata, subsets), $unicodeSubset)
)
) |
I'm actually not too familiar with Sass so I would really appreciate if someone could make a PR that addresses this and #738. It's a pretty simple template to edit if you know what you are doing. |
I think the current template is perfectly fine, the issue for me is the value set as default subset in the metada mixin template. I'm not exactly sure what is the source of this
As the Noto Sans font is a google font I guess that the metada comes from this json file, but I have no idea how this json file could be fixed. Is this json file generated by some script or is it retrieved from some google api ? If the source can't be fixed, there is always a possibility to hack something in the sass mixin itself but that would be a last resort |
It's retrieved by a Google API so we can't really change it because there are thousands of fonts and they can have differing Technically, the template default for |
I get what you're saying and I agree. I dug a bit more in the generation of metadata from the google-font-api-v2 and found that the json returned by the api does not provide a defSubset, it is added by the metadata generator @if (
($subset == $unicodeSubset) or
(
/*
Instead of trying to match the subset with the defSubset
we just check that the subset is in the list of subsets but not in the unicode subsets
which means we are looking to get the numbered unicode subsets
*/
map.has-key($metadata, subsets, $subset) and not
list.index(map.get($metadata, subsets), $unicodeSubset)
)
) This solution is quite easy and would solve the issue without breaking anything. What do you think ? |
Apologies. I completely forgot that it was added by us.
Give it a go! We have tests for compiled CSS (not too much though) so you can verify if something is going wrong. I still think we should update the default to use |
Ah yes, if it is ordered alphabetically then I understand the problematic and it does even make more sense to use
Ok, thank you for your guidance, I'll give it a go for both issues. |
@ayuhito It seems like I did not understood the contribution guideline correctly as I'm not able to open a PR |
Perhaps this guide would help you point your PR to this repository? TLDR; when clicking on "New pull request", you should see many options on where you can point your current branch to, including upstream repositories. |
@ayuhito thanks, it seems like I just missed the small link "compare accross fork" link when create a new PR. |
* fix: correctly generate numeric unicode subset faces [#949] * fix: missing update of snapshot data * style: indentation * fix: missed use case + add comments * fix: correctly generate numeric unicode subset faces [#949] * fix: missing update of snapshot data * style: indentation * fix: missed use case + add comments * fix: replace default subset by all * fix: unit test * chore: improve code documentation * Create yellow-deers-hope.md --------- Co-authored-by: Billy Rothstein - M306213 <billy.rothstein@merckgroup.com> Co-authored-by: Ayu <hello@ayuhito.com>
Describe the bug
I am using the
faces
mixin to integrate fonts in my SASS files, and due to some weird defaults (most fonts will only produce CSS for thelatin
subset!) I need to specify the font subsets to use.This worked well for most Noto fonts, but for the Chinese fonts it did not generate any CSS.
Steps to Reproduce
@use '@fontsource-variable/noto-sans-sc/scss/mixins' as NotoSansSC
@include NotoSerifSC.faces($directory: $fonts_dir, $subsets: all)
Expected behavior
Multiple
@font-face
definitions for the NotoSansSC font. But nothing is generatedVersion
No response
OS
No response
Browser
No response
Additional context
No response
The text was updated successfully, but these errors were encountered: