-
Notifications
You must be signed in to change notification settings - Fork 23
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
Build error: struct.error: 'H' format requires 0 <= number <= 65535 #453
Comments
compiling maxp is blowing up, maybe you've oveflown the maximum number of glyphs (65535) that an OpenType font can contains at the moment. How many SVGs did you pass as input? |
Uhhh... is 700 too much? 😓 |
no, that should be fine.. Could you please try to apply this patch to a local clone of github.com/fonttools/fonttools and install fonttools from that directory in editable mode ( diff --git a/Lib/fontTools/misc/sstruct.py b/Lib/fontTools/misc/sstruct.py
index d35bc9a5c..6f54f769c 100644
--- a/Lib/fontTools/misc/sstruct.py
+++ b/Lib/fontTools/misc/sstruct.py
@@ -72,7 +72,12 @@ def pack(fmt, obj):
elif isinstance(value, str):
value = tobytes(value)
elements.append(value)
- data = struct.pack(*(formatstring,) + tuple(elements))
+ try:
+ data = struct.pack(*(formatstring,) + tuple(elements))
+ except struct.error:
+ print("formatstring:", formatstring)
+ print("elements:", elements)
+ raise
return data |
|
the third field of maxp is maxPoints, there's a glyph that contains more than the maximum number of points (also an unsigned short)... |
These source files are raw data input from one of the testers. All of these are stroked paths made in Adobe Illustrator. Using only 4 SVG, it seems that all the glyph are concentrated on |
have you been able to indentify the offending SVG file that makes the maxp explode? Could you upload here or send privately via email so I can take a look? |
OK, I see. So the --glyphmap_file option is a private flag of the nanoemoji.write_fonts submodule, which is not meant to be passed directly to the main Note that the CSV must contain four (or more) columns: the first two are respectively the SVG and PNG file names (usually you only need the first and can leave the second one empty, it's only used for bitmap color tables); the third column is the desired glyph name, and the fourth, fifth, etc. are the unicode codepoints. These must be in hexadecimal format, so instead of writing it as text I hope this helps a bit. Thanks for trying out out tools and providing feedback! |
I see, thank you. I would also like to ask if it is possible to not separate each element as its own glyph since I don't see such options? I understand it is used for |
Sorry I don't understand what you mean when you say "not separate each element as its own glyph", can you please clarify/make example? Thanks |
When running the following code, it reports
'H' format requires 0 <= number <= 65535
.test-strokesvg.csv
SVG files: test-strokesvg.zip
The text was updated successfully, but these errors were encountered: