[hhea/vhea] cast to int when using math.ceil and floor

Fixes https://github.com/fonttools/fonttools/issues/1064
This commit is contained in:
Cosimo Lupo 2017-10-05 13:27:13 +01:00
parent 72927cde87
commit ae73c45e6a
2 changed files with 4 additions and 2 deletions

View File

@ -68,7 +68,8 @@ class table__h_h_e_a(DefaultTable.DefaultTable):
cs = topDict.CharStrings[name]
bounds = cs.calcBounds()
if bounds is not None:
boundsWidthDict[name] = math.ceil(bounds[2]) - math.floor(bounds[0])
boundsWidthDict[name] = int(
math.ceil(bounds[2]) - math.floor(bounds[0]))
if boundsWidthDict:
minLeftSideBearing = float('inf')

View File

@ -67,7 +67,8 @@ class table__v_h_e_a(DefaultTable.DefaultTable):
cs = topDict.CharStrings[name]
bounds = cs.calcBounds()
if bounds is not None:
boundsHeightDict[name] = math.ceil(bounds[3]) - math.floor(bounds[1])
boundsHeightDict[name] = int(
math.ceil(bounds[3]) - math.floor(bounds[1]))
if boundsHeightDict:
minTopSideBearing = float('inf')