[cffLib.transforms] Handle an attribute error
Fixes https://github.com/fonttools/fonttools/issues/3695
This commit is contained in:
parent
756c893b84
commit
b8635fee62
@ -457,7 +457,12 @@ def remove_unused_subroutines(cff):
|
|||||||
if subrs == font.GlobalSubrs:
|
if subrs == font.GlobalSubrs:
|
||||||
if not hasattr(font, "FDArray") and hasattr(font.Private, "Subrs"):
|
if not hasattr(font, "FDArray") and hasattr(font.Private, "Subrs"):
|
||||||
local_subrs = font.Private.Subrs
|
local_subrs = font.Private.Subrs
|
||||||
elif hasattr(font, "FDArray") and len(font.FDArray) == 1:
|
elif (
|
||||||
|
hasattr(font, "FDArray")
|
||||||
|
and len(font.FDArray) == 1
|
||||||
|
and hasattr(font.FDArray[0].Private, "Subrs")
|
||||||
|
):
|
||||||
|
# Technically we shouldn't do this. But I've run into fonts that do it.
|
||||||
local_subrs = font.FDArray[0].Private.Subrs
|
local_subrs = font.FDArray[0].Private.Subrs
|
||||||
else:
|
else:
|
||||||
local_subrs = None
|
local_subrs = None
|
||||||
|
Loading…
x
Reference in New Issue
Block a user