Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Don’t report Z... as a primary script #714

Merged
merged 2 commits into from
Sep 4, 2023
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions Lib/gftools/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -513,10 +513,11 @@ 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"]
badkeys = [key for key in g.keys() if key.startswith("Z")]
simoncozens marked this conversation as resolved.
Show resolved Hide resolved
if "Latn" in g and ignore_latin:
del g["Latn"]
badkeys.append("Latn")
for badkey in badkeys:
del g[badkey]
script_count = Counter({k:len(v) for k,v in g.items()})

# If there isn't a clear winner, give up
Expand Down
Loading