-
Notifications
You must be signed in to change notification settings - Fork 17
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
Fix multiplication of fontinfo slant and italic angles #189
Fix multiplication of fontinfo slant and italic angles #189
Conversation
So what's going on seems to be that both @typesupply not quite sure what to do here. I'd assume that we want to interpolate the value like any other, but factor in anisotropy? |
I defer to @LettError. |
Interesting that this never came up before! Here is a small change that seems to bring the expected results. I don't know where the Simpler example that doesn't need fontmake. import math
from fontParts.world import RFont
f = RFont()
f.info.italicAngle = 10
m = f.info.toMathInfo(guidelines=True)
m1 = m - m
r1 = RFont()
m1.extractInfo(r1.info)
assert r1.info.italicAngle == 0
m2 = m + m + m
r2 = RFont()
m2.extractInfo(r2.info)
assert r2.info.italicAngle == 30
m3 = 10 * m
r3 = RFont()
m3.extractInfo(r3.info)
assert r3.info.italicAngle == 100
m4 = m / 20
r4 = RFont()
m4.extractInfo(r4.info)
assert r4.info.italicAngle == 0.5 |
@madig Just checking in on this |
Hi! 👋 need anything from me? |
1901c45
to
0dd3baf
Compare
0dd3baf
to
a726893
Compare
I stumbled over this again and eventually remembered that I opened this PR a year ago :D I implemented LettError's suggestion. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, but we should wait for @LettError to weigh in before merging, he's more familiar with the code than I am
LGTM. The test values are indeed what one would expect to see. |
A fontinfo's
italicAngle
andpostscriptSlantAngle
do not seem to interpolate correctly.Initially found with this reproducer (the last assert fails):
After some digging with @belluzj, we found that
test_mul
fails on these two attributes if they're non-zero, as if they're skipped. More digging required.