8000 [varLib.mutator] Does not mutate weight/width/italicAngle · Issue #1264 · fonttools/fonttools · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

[varLib.mutator] Does not mutate weight/width/italicAngle #1264

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

Closed
behdad opened this issue May 22, 2018 · 9 comments
Closed

[varLib.mutator] Does not mutate weight/width/italicAngle #1264

behdad opened this issue May 22, 2018 · 9 comments
Assignees

Comments

@behdad
Copy link
Member
behdad commented May 22, 2018

Because those are not in MVAR, but in standard axes. Quoting MVAR spec:

Note: The OS/2.usWeightClass, OS/2.usWidthClass and post.italicAngle values are not supported by variation data in the 'MVAR' table. This is because values for these three fields correspond directly to input axis values for the 'wght', 'wdth' and 'slnt' variation axes. See the discussion of these axes in the OpenType Design-Variation Axis Tag Registry for details on the relationship between these fields and the corresponding design axes.

There's probably some binary flags that we can also tweak, re boldness, italicness, etc of the font.

@anthrotype
Copy link
Member

There's probably some binary flags that we can also tweak, re boldness, italicness, etc of the font

OK, it's clear what to do with OS/2.usWeightClass, usWidthClass and post.italicAngle.

But, about the OS/2.fsSelection or head.macStyle which @behdad is hinting at in his comment -- when exactly do we want to set the bold flags? Say, when the location on the wght
axis and the corresponding OS/2.usWeightClass is exactly 700? But not when it's 699 or 900 or whatever?

And about the "italic" font selection flags, I think we should not set those based on "slnt" axis. The latter should only be correlated to the "post.italicAngle". The "ital" registered axis might be used instead, but again if we do that, where do we put the threshold? When it's 100% italic, or >= 50 %?
This all seem a bit arbitrary to me.

@behdad
Copy link
Member Author
behdad commented Jun 18, 2018

Thanks for working on this.

Re bold bit, I think anything > SemiBold should be marked as bold...

@anthrotype
Copy link
Member
anthrotype commented Jun 19, 2018

hmm I'm not sure that's a good idea.
Usually in a family where there are several bolder variants, only one of them, namely the "Bold", around 700 weightClass, is the one that gets the bold fontSelection/macStyle flags enabled. A "Black" or similar may be bolder than Bold, but they don't usually get the bold flag enabled.

@anthrotype
Copy link
Member

(dind't mean to close, sorry)

@anthrotype anthrotype reopened this Jun 19, 2018
@anthrotype
Copy link
Member
anthrotype commented Jun 19, 2018

actually, maybe for setting the Bold (and Italic) font selection flags, we should not look at the OS/2 weightClass at all, but rather we should use the STAT table. Hm, yeah 🤔
ok i'll merge this for now, will work on the latter later.

@m4rc1e
Copy link
Contributor
m4rc1e commented Jun 19, 2018

Google Fonts only sets fsSelection bits and macStyle bits to bold for the Bold style only. SemiBold, Black, ExtraBlack etc are set to Regular.

@anthrotype anthrotype reopened this Jun 19, 2018
@m4rc1e
Copy link
Contributor
m4rc1e commented Jun 19, 2018

We have a sheet outlining how we set bits and names for each style, https://docs.google.com/spreadsheets/d/1ckHigO7kRxbm9ZGVQwJ6QJG_HjV_l_IRWJ_xeWnTSBg/edit#gid=0. Some of this may be out of date though.

@anthrotype
Copy link
Member
anthrotype commented Sep 18, 2018

OS/2 weight/width class and post.italicAngle have been implmented already with #1276

for the OS/2.fsSelection and head.macStyle bits, I'm not sure what we should do. Maybe simply check the nameID=2 (legacy style name used for RBBI style-linking) and set Bold/Italic flags when the string exactly matches either "Italic", "Bold" or "Bold Italic"?

@behdad
Copy link
Member Author
behdad commented Aug 19, 2022

mutator is on the way to be deprecated in favor of instancer module.

@behdad behdad closed this as not planned Won't fix, can't repro, duplicate, stale Aug 19, 2022
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

3 participants
0