diff --git a/Lib/gftools/utils.py b/Lib/gftools/utils.py index 8090b58cf..98f4d4a36 100644 --- a/Lib/gftools/utils.py +++ b/Lib/gftools/utils.py @@ -513,10 +513,12 @@ def remove_url_prefix(url): def primary_script(ttFont, ignore_latin=True): g = classifyGlyphs(lambda uv:list(ftunicodedata.script_extension(chr(uv))), ttFont.getBestCmap(), gsub=ttFont.get("GSUB")) - if "Zyyy" in g: - del g["Zyyy"] - if "Latn" in g and ignore_latin: - del g["Latn"] + badkeys = ["Zinh", "Zyyy", "Zzzz"] + if ignore_latin: + badkeys.append("Latn") + for badkey in badkeys: + if badkey in g: + del g[badkey] script_count = Counter({k:len(v) for k,v in g.items()}) # If there isn't a clear winner, give up