-
Notifications
You must be signed in to change notification settings - Fork 487
[merge] handle cmap format=14 subtable #3830
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
Conversation
f2c41f2
to
71de136
Compare
mapId = id(table.uvsDict if table.isUVS() else table.cmap) | ||
offset = seen.get(mapId) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why this change? The PR title and description only mention the merge tool but this seems to be changing the cmap table compile method itself.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good question. Previously I thought cmap
was not defined in the format=14 subtable, it turns out we have defined a dummy cmap
property being an empty dictionary.
fonttools/Lib/fontTools/fontBuilder.py
Line 433 in f9c3b63
uvsSubTable = buildCmapSubTable({}, 14, 0, 5) |
I will revise the merger logic and hopefully we don't have to change the cmap compile method.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the changes to the merge.py and corresponding tests look good to me. But see my other question about _c_m_a_p.py
This reverts commit 71de136. # Conflicts: # Lib/fontTools/ttLib/tables/_c_m_a_p.py
In this PR we add cmap format=14 table support to the merge tool.
For duplicate UVS mapping entries, the tool prefer the previous font, aligned with how we deal with cmap duplicates.