Fix hhea/vhea compile with metrics tables

This commit is contained in:
Behdad Esfahbod 2017-08-16 16:41:09 -07:00
parent d11e7d98e8
commit 03cf8fc157
2 changed files with 6 additions and 4 deletions

View File

@ -46,8 +46,9 @@ class table__h_h_e_a(DefaultTable.DefaultTable):
return sstruct.pack(hheaFormat, self)
def recalc(self, ttFont):
hmtxTable = ttFont['hmtx']
self.advanceWidthMax = max(adv for adv, _ in hmtxTable.metrics.values())
if 'hmtx' in ttFont:
hmtxTable = ttFont['hmtx']
self.advanceWidthMax = max(adv for adv, _ in hmtxTable.metrics.values())
boundsWidthDict = {}
if 'glyf' in ttFont:

View File

@ -45,8 +45,9 @@ class table__v_h_e_a(DefaultTable.DefaultTable):
return sstruct.pack(vheaFormat, self)
def recalc(self, ttFont):
vmtxTable = ttFont['vmtx']
self.advanceHeightMax = max(adv for adv, _ in vmtxTable.metrics.values())
if 'vmtx' in ttFont:
vmtxTable = ttFont['vmtx']
self.advanceHeightMax = max(adv for adv, _ in vmtxTable.metrics.values())
boundsHeightDict = {}
if 'glyf' in ttFont: