Fix UnbouldLocalError and let {h,v}hea be no-op when no {v,h}mtx is present
Fixes https://github.com/fonttools/fonttools/issues/3289
This commit is contained in:
parent
4e2f80cc08
commit
442576fb1f
@ -67,9 +67,11 @@ class table__h_h_e_a(DefaultTable.DefaultTable):
|
||||
return sstruct.pack(hheaFormat, self)
|
||||
|
||||
def recalc(self, ttFont):
|
||||
if "hmtx" in ttFont:
|
||||
hmtxTable = ttFont["hmtx"]
|
||||
self.advanceWidthMax = max(adv for adv, _ in hmtxTable.metrics.values())
|
||||
if "hmtx" not in ttFont:
|
||||
return
|
||||
|
||||
hmtxTable = ttFont["hmtx"]
|
||||
self.advanceWidthMax = max(adv for adv, _ in hmtxTable.metrics.values())
|
||||
|
||||
boundsWidthDict = {}
|
||||
if "glyf" in ttFont:
|
||||
|
@ -50,9 +50,11 @@ class table__v_h_e_a(DefaultTable.DefaultTable):
|
||||
return sstruct.pack(vheaFormat, self)
|
||||
|
||||
def recalc(self, ttFont):
|
||||
if "vmtx" in ttFont:
|
||||
vmtxTable = ttFont["vmtx"]
|
||||
self.advanceHeightMax = max(adv for adv, _ in vmtxTable.metrics.values())
|
||||
if "vmtx" not in ttFont:
|
||||
return
|
||||
|
||||
vmtxTable = ttFont["vmtx"]
|
||||
self.advanceHeightMax = max(adv for adv, _ in vmtxTable.metrics.values())
|
||||
|
||||
boundsHeightDict = {}
|
||||
if "glyf" in ttFont:
|
||||
|
Loading…
x
Reference in New Issue
Block a user