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

Variable Fonts Support for Custom Packager #728

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

Variable Fonts Support for Custom Packager #728

ayuhito opened this issue May 26, 2023 · 2 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 supports non-variable fonts. I think having the option to generate a variable package would be great as variable fonts become more and more popular.

@ayuhito ayuhito added the enhancement New feature or request label May 26, 2023
@ayuhito ayuhito added the contributors welcome! Open to outside contributors label May 26, 2023
@herrstrietzel
Copy link

Thanks for this great project!

As a starting point you might include the axes data in the API item properties similar to the official google API output:

Example: Open Sans

https://api.fontsource.org/v1/fonts?family=Open+Sans&variable=true

[
    {
        "id": "open-sans",
        "family": "Open Sans",
        "subsets": [
            "cyrillic",
            "cyrillic-ext",
            "greek",
            "greek-ext",
            "hebrew",
            "latin",
            "latin-ext",
            "vietnamese"
        ],
        "weights": [
            300,
            400,
            500,
            600,
            700,
            800
        ],
        "styles": [
            "italic",
            "normal"
        ],

        "axes": [
            {
              "tag": "wdth",
              "start": 75,
              "end": 100
            },
            {
              "tag": "wght",
              "start": 300,
              "end": 800
            }
          ],
        "defSubset": "latin",
        "variable": true,
        "lastModified": "2022-09-22",
        "category": "sans-serif",
        "license": "OFL-1.1",
        "type": "google"
    }
]

@ayuhito
Copy link
Member Author

ayuhito commented Jul 9, 2023

The actual complexity of this lies in the subsetting of these fonts. We want to ship individual axes as well as custom mixed axes such as standard, so it would be likely for us to need to integrate fonttools/fontmake ourselves extensively for processing.

This honestly seems like a lot of work to support and maintain. Since Google Fonts, which has a full fledged team, is already supporting most of this, it also seems unnecessary for us to replicate their build pipeline and instead wait for them to add new fonts.

If there's a simpler solution that can be easily automated, I'd still be open to it.

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