Skip to content
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

Adding Subsets for Custom Packager #730

Open
ayuhito opened this issue May 26, 2023 · 5 comments
Open

Adding Subsets for Custom Packager #730

ayuhito opened this issue May 26, 2023 · 5 comments
Labels
contributors welcome! Open to outside contributors enhancement New feature or request

Comments

@ayuhito
Copy link
Member

ayuhito commented May 26, 2023

Description

The current custom packager only defaults to subset latin since it has no information on what subsets a given font may support. Therefore, we can't give it proper unicode-range values either. We should have a preprocessor that determines what subsets the font supports and split it accordingly matching how Google does it.

@tmikaeld
Copy link

tmikaeld commented Jan 19, 2024

Is this why ext fonts doesn't render properly at all?

For example, courier prime latin looks like this:
image

But the latin ext woff2 looks like this:
image

I noticed when testing on https://fontsource.org/fonts/courier-prime that it doesn't load the ext font att all when choosing it from the dropdown, it's still showing latin.

Update: Seems all ext fonts are broken

@ayuhito
Copy link
Member Author

ayuhito commented Jan 19, 2024

@tmikaeld, that is intentional. latin-ext does not support any characters latin does. They are exclusionary to each other. For example, latin-ext only includes support for diacritics etc.

Usually our CSS files include both and the unicode-range selector automatically determines what subsets to download depending on the characters on the page.

I suppose our subsets documentation could be improved to make that distinction clearer.

@tmikaeld
Copy link

tmikaeld commented Jan 19, 2024

Right, so both latin and latin-ext should be loaded.

Does this apply to any other subsets?

@ayuhito
Copy link
Member Author

ayuhito commented Jan 19, 2024

Does this apply to any other subsets?

It applies to all other subsets. They only support their specific range of characters and you need to combine them with unicode-range.

The only case this does not apply is non-Google fonts where our custom packager for that does not support subsetting and therefore every subset is usually included in one file.

@tmikaeld
Copy link

I'll move to a discussion instead of polluting this issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
contributors welcome! Open to outside contributors enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants