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

how to get a variable instance of a variable font #120

Closed
690591397 opened this issue Apr 7, 2023 · 2 comments
Closed

how to get a variable instance of a variable font #120

690591397 opened this issue Apr 7, 2023 · 2 comments

Comments

@690591397
Copy link

Just like https://opentype.js.org/font-inspector.html select the instances under the Font Variations table parsed by Font Inspector.

{"name":{"en":"Ultra Compressed Ultralight"},"coordinates":{"wdth":30,"opsz":28,"GRAD":400,"wght":30.925017166399634}}
...

2023-04-07 10 56 53

@690591397
Copy link
Author

use name table.

@RazrFalcon
Copy link
Collaborator

    if let (Some(fvar_table), Some(name_table)) = (face.tables().fvar, face.tables().name) {
        for axis in fvar_table.axes {
            if let Some(name) = name_table.names.get(axis.name_id) {
                println!("{:?}", name.to_string());
            }
        }
    }

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants