-
Notifications
You must be signed in to change notification settings - Fork 475
Graphite table support #1054
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
Graphite table support #1054
Conversation
Nice! Do you plan adding unit tests? Something like this, for example. Tests help a lot when maintaining a large codebase. |
Thank you Martin for working on this! 👍 one minor suggestion I was thinking of, that |
import struct | ||
import operator | ||
import warnings | ||
from _ast import Num |
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.
this import seems unused
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.
Cleared out the redundant imports there. I'll use graphiteUtils if you use opentypeUtils :) gr || ot just as graphite || opentype.
Are the specs for these tables available online? |
The specs are available as part of the Graphite source tree in doc/GTF.txt. I did consider trying to use the otData machinery but it would have involved so many extensions to the core supporting types and a huge growth in what are already big files that I felt it better to use the old approach. I did try to use it for the Feat table, but gave up after it refused to accept any table with a version > 1! The otData machinery is very tightly tied together and hard to open up and as such is really only good for tables that are part of the OT machinery and that can make best use of the monolithic structure. Now, if I were starting again on the Graphite binary format, I would probably go for something much closer in style to the OT structures to make use of such machinery. But even then I don't know how close I would get. |
Test are in. |
I'm done fiddling subject to fixing up review comments. |
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.
Thank you! Looks good to me.
This PR adds support for the Graphite font tables: Feat, Glat, Gloc, Silf, Sill providing ttx XML support as well.