8000 Graphite table support by mhosken · Pull Request #1054 · fonttools/fonttools · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

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

Merged
merged 13 commits into from
Sep 19, 2017
Merged

Graphite table support #1054

merged 13 commits into from
Sep 19, 2017

Conversation

mhosken
Copy link
Contributor
@mhosken mhosken commented Sep 14, 2017

This PR adds support for the Graphite font tables: Feat, Glat, Gloc, Silf, Sill providing ttx XML support as well.

@brawer
Copy link
Collaborator
brawer commented Sep 14, 2017

Nice! Do you plan adding unit tests? Something like this, for example. Tests help a lot when maintaining a large codebase.

@anthrotype
Copy link
Member

Thank you Martin for working on this! 👍
Yes, some simple tests would be nice to have.

one minor suggestion I was thinking of, that fontTools/ttLib/tables/grUtils.py module could named more explicitly graphiteUtils maybe?

import struct
import operator
import warnings
from _ast import Num
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this import seems unused

Copy link
Contributor Author

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.

@behdad
Copy link
Member
behdad commented Sep 15, 2017

Are the specs for these tables available online?
Can these tables be implemented using the otData machinery? I prefer not adding more hand-coded table parsing if we can avoid it.

@mhosken
Copy link
Contributor Author
mhosken commented Sep 15, 2017

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.

@mhosken
Copy link
Contributor Author
mhosken commented Sep 15, 2017

Test are in.

@mhosken
Copy link
Contributor Author
mhosken commented Sep 18, 2017

I'm done fiddling subject to fixing up review comments.

Copy link
Collaborator
@brawer brawer left a 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.

@brawer brawer merged commit 437b3ea into fonttools:master Sep 19, 2017
@mhosken mhosken deleted the graphite branch September 19, 2017 16:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants
0