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)
|
return sstruct.pack(hheaFormat, self)
|
||||||
|
|
||||||
def recalc(self, ttFont):
|
def recalc(self, ttFont):
|
||||||
if "hmtx" in ttFont:
|
if "hmtx" not in ttFont:
|
||||||
hmtxTable = ttFont["hmtx"]
|
return
|
||||||
self.advanceWidthMax = max(adv for adv, _ in hmtxTable.metrics.values())
|
|
||||||
|
hmtxTable = ttFont["hmtx"]
|
||||||
|
self.advanceWidthMax = max(adv for adv, _ in hmtxTable.metrics.values())
|
||||||
|
|
||||||
boundsWidthDict = {}
|
boundsWidthDict = {}
|
||||||
if "glyf" in ttFont:
|
if "glyf" in ttFont:
|
||||||
|
@ -50,9 +50,11 @@ class table__v_h_e_a(DefaultTable.DefaultTable):
|
|||||||
return sstruct.pack(vheaFormat, self)
|
return sstruct.pack(vheaFormat, self)
|
||||||
|
|
||||||
def recalc(self, ttFont):
|
def recalc(self, ttFont):
|
||||||
if "vmtx" in ttFont:
|
if "vmtx" not in ttFont:
|
||||||
vmtxTable = ttFont["vmtx"]
|
return
|
||||||
self.advanceHeightMax = max(adv for adv, _ in vmtxTable.metrics.values())
|
|
||||||
|
vmtxTable = ttFont["vmtx"]
|
||||||
|
self.advanceHeightMax = max(adv for adv, _ in vmtxTable.metrics.values())
|
||||||
|
|
||||||
boundsHeightDict = {}
|
boundsHeightDict = {}
|
||||||
if "glyf" in ttFont:
|
if "glyf" in ttFont:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user