8000 [mutator] set usWeightClass, usWidthClass and italicAngle by anthrotype · Pull Request #1276 · fonttools/fonttools · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

[mutator] set usWeightClass, usWidthClass and italicAngle #1276

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

Merged
merged 4 commits into from
Jun 19, 2018

Conversation

anthrotype
Copy link
Member

Fixes #1264

@anthrotype anthrotype force-pushed the mutator-wght-wdth-slnt branch from 25c8dfe to 0234b9d Compare June 18, 2018 18:45
if "wdth" in location:
wdth = location["wdth"]
for percent, widthClass in sorted(OS2_WIDTH_CLASS_VALUES.items()):
if wdth <= percent:
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure if this is correct, or if we should round in a more clever way, testing in the middle of those predefined percent intervals...

this is the mapping between the half of each percentage intervals and
the associated usWidthClass:

{56.25: 1,
 68.75: 2,
 81.25: 3,
 93.75: 4,
 106.25: 5,
 118.75: 6,
 137.5: 7,
 175.0: 8}

Notice how wdth=80 (in the adjusted test case) will fall in width class
3, instead of 4, because it is < 81.25, thus closer to the nominal 75
than to 87.5.
@anthrotype
Copy link
Member Author

ok, i'm rounding to the closest width class now

@anthrotype anthrotype merged commit 4c0dbd1 into fonttools:master Jun 19, 2018
@anthrotype anthrotype changed the title WIP [mutator] set usWeightClass, usWidthClass and italicAngle [mutator] set usWeightClass, usWidthClass and italicAngle Jun 19, 2018
@anthrotype anthrotype deleted the mutator-wght-wdth-slnt branch June 19, 2018 16:24
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

Successfully merging this pull request may close these issues.

2 participants
0