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

Too many Layers? AssertionError in FontTools TTLib #450

Open
Graullon opened this issue May 7, 2023 · 2 comments
Open

Too many Layers? AssertionError in FontTools TTLib #450

Graullon opened this issue May 7, 2023 · 2 comments

Comments

@Graullon
Copy link

Graullon commented May 7, 2023

Hello there! I'm trying to build .ttf font from a pretty big amount of .svg (like 3000+, most of them are from Noto Color Emoji) with COLRv0 support. Unfortunately, I'm stuck with build error. Error stack trace you can see in attached .txt file. As far as I understand a situation, nanoemoji generates more than 65536 layers for COLRv0 table that results in error. Similar error and discussion are present at: fonttools/fonttools#2364. Maybe nanoemoji can restrict number of layers or any other suggestions?

COLRv0 Compile Error.txt

@anthrotype
Copy link
Member

anthrotype commented May 9, 2023

well, the max 65536 layers is a limitation of the COLR version 0 format, there's nothing we can do about that, you should try passing in less svg inputs that can fit. I believe it will work if you create instead a COLR version 1 font, as that uses 32 bit integers for offsets and lengths. Consider using COLRv1 if that's an option, and maybe use the other nanoemoji's script, maximum_color, to produce an OT-SVG variant of your COLRv1 font for environments that don't support COLRv1.

@Graullon
Copy link
Author

Graullon commented May 9, 2023

Yeah, less input helps. I want to use font with Qt Framework, but current Qt 6.5 LTS supports only COLRv0 on WIndows (through DirectWrite). Use of Freetype helps, windows compatible version works mostly on every OS. Ofc its question for Qt why they don't support more font tables through DirectWrite. Anyway, thanks for help!

Will leave this for future generations: building COLRv0 by nanoemoji and Noto Color Emoji SVG set provides bad results, font works on Windows Qt 6.5. but bad quality, no gradients etc, so no reason to try.

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

No branches or pull requests

2 participants