Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

scaling a font's UPEM with fontMath #193

Closed
anthrotype opened this issue May 14, 2020 · 0 comments · Fixed by #194
Closed

scaling a font's UPEM with fontMath #193

anthrotype opened this issue May 14, 2020 · 0 comments · Fixed by #194

Comments

@anthrotype
Copy link
Member

anthrotype commented May 14, 2020

I would like to scale a UFO's unitsPerEm, while keeping the font the same by scaling everything else at the same time.
I thought I could simply use fontMath since it already implements __mul__ on info, kerning and glyph objects.
Here's what I have:

https://gist.github.com/anthrotype/62d0bfe1d38b8f11a199bd3b66574bcc

Now the problem is the components' xScale and yScale are also scaled by the given factor, which is not what I was expecting. Say they are set to 1.0 in the input font, if I multiply the glyphs by a factor or 2, I get the component scale set to 2.0. The simple contour glyphs have also been scaled by the same amount already, I don't want the components to be scaled again.

I was thinking we may add an option in MathGlyph constructor to only scale the component's offsets and exclude the other scale/shear attributes?

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

Successfully merging a pull request may close this issue.

1 participant