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

[ttfcomponentizer] Set maxp table's maxComponentElements value #710

Closed
miguelsousa opened this issue Jan 9, 2019 · 7 comments
Closed

[ttfcomponentizer] Set maxp table's maxComponentElements value #710

miguelsousa opened this issue Jan 9, 2019 · 7 comments
Assignees
Labels

Comments

@miguelsousa
Copy link
Member

Even though FontTools recalculates most of maxp table values, maxComponentElements is not one of them and needs to be explicitly set otherwise it ends up as zero.

Related issues:
adobe-fonts/source-sans#154
adobe-fonts/source-serif#44

@anthrotype
Copy link
Member

maybe fonttools should do that. if you like to work on a PR i'd be happy to review

@miguelsousa
Copy link
Member Author

@anthrotype upon looking at the code it seems that all that's needed is a one-line change:

--- a/Lib/fontTools/ttLib/tables/_m_a_x_p.py
+++ b/Lib/fontTools/ttLib/tables/_m_a_x_p.py
@@ -107,6 +107,7 @@ class table__m_a_x_p(DefaultTable.DefaultTable):
                self.maxContours = maxContours
                self.maxCompositePoints = maxCompositePoints
                self.maxCompositeContours = maxCompositeContours
+               self.maxComponentElements = maxComponentElements
                self.maxComponentDepth = maxComponentDepth
                if allXMinIsLsb:
                        headTable.flags = headTable.flags | 0x2

I'll make the PR now.

@anthrotype
Copy link
Member

ouch! since when has this been broken?

@anthrotype
Copy link
Member

according to git blame, since day one (Dec 16 1999)
good catch!

@anthrotype
Copy link
Member

@miguelsousa
Copy link
Member Author

thanks

@miguelsousa
Copy link
Member Author

fixed via fonttools/fonttools#1433

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants