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

makeinstancesufo fixes for fontMath 0.8.1 update #1391

Merged
merged 3 commits into from
Jul 26, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 8 additions & 4 deletions python/afdko/makeinstancesufo.py
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,10 @@ def roundSelectedFontInfo(fontInfo):
elif prop_name in ('postscriptBlueFuzz', 'postscriptBlueShift',
'postscriptSlantAngle'):
round_val = round(prop_val, 2)

elif prop_name == 'italicAngle':
round_val = round(prop_val)

else:
round_val = int(round(prop_val))

Expand Down Expand Up @@ -191,17 +195,17 @@ def postProcessInstance(fontPath, options):
clearCustomLibs(dFont)

if options.no_round:
# '-r/--no-round' option was used but certain values (glyph widths,
# kerning values, font info values) still need to be rounded because
# of how they are stored in the final OTF
roundSelectedFontInfo(dFont.info)
roundGlyphWidths(dFont)
roundKerningValues(dFont)
else:
# ufoProcessor does not round kerning values nor postscriptBlueScale
# when 'roundGeometry' = False
roundPostscriptBlueScale(dFont.info)
roundKerningValues(dFont)
# even if '-r/--no-round' option was used, certain values (glyph widths,
# kerning values, font info values) still need to be rounded because
# of how they are stored in the final OTF
roundSelectedFontInfo(dFont.info)

dFont.save()

Expand Down
6 changes: 3 additions & 3 deletions requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@
lxml==4.6.3
booleanOperations==0.9.0
defcon[lxml,pens]==0.8.1
fontMath==0.6.0
fontTools[woff,unicode,lxml,ufo]==4.24.4
fontMath==0.8.1
fontTools[ufo,woff,lxml,unicode]==4.25.1
psautohint==2.3.0
tqdm==4.61.1
tqdm==4.61.2
ufonormalizer==0.5.4
ufoProcessor==1.9.0
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
<array>
</array>
<key>italicAngle</key>
<integer>-180</integer>
<integer>0</integer>
<key>postscriptBlueFuzz</key>
<integer>0</integer>
<key>postscriptBlueScale</key>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
<key>guidelines</key>
<array/>
<key>italicAngle</key>
<integer>2</integer>
<integer>1</integer>
<key>openTypeHheaAscender</key>
<integer>1036</integer>
<key>openTypeHheaDescender</key>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
<array>
</array>
<key>italicAngle</key>
<integer>2</integer>
<integer>0</integer>
<key>openTypeHheaAscender</key>
<integer>1036</integer>
<key>openTypeHheaDescender</key>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
<key>guidelines</key>
<array/>
<key>italicAngle</key>
<integer>2</integer>
<integer>0</integer>
<key>openTypeHheaAscender</key>
<integer>1036</integer>
<key>openTypeHheaDescender</key>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
<array>
</array>
<key>italicAngle</key>
<integer>2</integer>
<integer>1</integer>
<key>openTypeHheaAscender</key>
<integer>1036</integer>
<key>openTypeHheaDescender</key>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
<key>familyName</key>
<string>Source Serif Pro</string>
<key>italicAngle</key>
<integer>2</integer>
<integer>0</integer>
<key>openTypeHheaAscender</key>
<integer>1036</integer>
<key>openTypeHheaDescender</key>
Expand Down