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

Match fonts based on weight rather than on name #83

Open
ToxicFrog opened this issue Mar 14, 2020 · 0 comments
Open

Match fonts based on weight rather than on name #83

ToxicFrog opened this issue Mar 14, 2020 · 0 comments
Assignees

Comments

@ToxicFrog
Copy link
Owner

At the moment, get_ligature_source tries to match a font based on the filename, assuming that if it exactly matches the suffix on one of the Fira Code names, it should use that, otherwise it should use "bold" for "bold" or "heavy" fonts and "regular" for everything else.

Instead, it should match based on weight, stored in the os2_weight field. The weights for Fira Code are:

300 Light
400 Regular
450 Retina
500 Medium
700 Bold

It should pick the closest weight; in the case of a tie, it's probably best to select the lighter weight, but I'm not sure.

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

No branches or pull requests

1 participant