Skip to content

Commit

Permalink
Write final values into some tables
Browse files Browse the repository at this point in the history
This helps with not having to reload some tables for the final values.
  • Loading branch information
madig committed Apr 1, 2021
1 parent bf17ab6 commit fb5be6f
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions Lib/ufo2ft/outlineCompiler.py
Expand Up @@ -537,7 +537,7 @@ def setupTable_OS2(self):
# subscript, superscript, strikeout values, taken from AFDKO:
# FDK/Tools/Programs/makeotf/makeotf_lib/source/hotconv/hot.c
unitsPerEm = getAttrWithFallback(font.info, "unitsPerEm")
italicAngle = getAttrWithFallback(font.info, "italicAngle")
italicAngle = float(getAttrWithFallback(font.info, "italicAngle"))
xHeight = getAttrWithFallback(font.info, "xHeight")

def adjustOffset(offset, angle):
Expand Down Expand Up @@ -889,7 +889,7 @@ def setupTable_post(self):
font = self.ufo
post.formatType = 3.0
# italic angle
italicAngle = getAttrWithFallback(font.info, "italicAngle")
italicAngle = float(getAttrWithFallback(font.info, "italicAngle"))
post.italicAngle = italicAngle
# underline
underlinePosition = getAttrWithFallback(
Expand All @@ -900,7 +900,9 @@ def setupTable_post(self):
font.info, "postscriptUnderlineThickness"
)
post.underlineThickness = otRound(underlineThickness)
post.isFixedPitch = getAttrWithFallback(font.info, "postscriptIsFixedPitch")
post.isFixedPitch = int(
getAttrWithFallback(font.info, "postscriptIsFixedPitch")
)
# misc
post.minMemType42 = 0
post.maxMemType42 = 0
Expand Down Expand Up @@ -1218,8 +1220,8 @@ def setupTable_CFF(self):
)
topDict.Weight = getAttrWithFallback(info, "postscriptWeightName")
# populate various numbers
topDict.isFixedPitch = getAttrWithFallback(info, "postscriptIsFixedPitch")
topDict.ItalicAngle = getAttrWithFallback(info, "italicAngle")
topDict.isFixedPitch = int(getAttrWithFallback(info, "postscriptIsFixedPitch"))
topDict.ItalicAngle = float(getAttrWithFallback(info, "italicAngle"))
underlinePosition = getAttrWithFallback(info, "postscriptUnderlinePosition")
topDict.UnderlinePosition = otRound(underlinePosition)
underlineThickness = getAttrWithFallback(info, "postscriptUnderlineThickness")
Expand Down

0 comments on commit fb5be6f

Please sign in to comment.