varLib.errors: use getBestFullName to print name of master ttf

This commit is contained in:
Cosimo Lupo 2022-06-13 12:08:40 +01:00
parent 69c131a1c2
commit 513b7d9a36

View File

@ -30,12 +30,8 @@ class VarLibMergeError(VarLibError):
def _master_name(self, ix):
if self.merger is not None:
ttf = self.merger.ttfs[ix]
if (
"name" in ttf
and ttf["name"].getDebugName(1)
and ttf["name"].getDebugName(2)
):
return ttf["name"].getDebugName(1) + " " + ttf["name"].getDebugName(2)
if "name" in ttf and ttf["name"].getBestFullName():
return ttf["name"].getBestFullName()
elif hasattr(ttf.reader, "file") and hasattr(ttf.reader.file, "name"):
return ttf.reader.file.name
return f"master number {ix}"