Float yMin value: required argument is not an integer
See original GitHub issueIf a font file has a float value in yMin
—and I assume equally in xMin
, xMax
or yMax
—it will fail to save with the error required argument is not an integer
(fontTools/misc/sstruct.py in pack at line 75
, fonttools v3.40.0).
Trace:
fontTools/misc/sstruct.py in pack at line 75
fontTools/ttLib/tables/_h_e_a_d.py in compile at line 69
fontTools/ttLib/ttFont.py in getTableData at line 651
fontTools/ttLib/ttFont.py in _writeTable at line 633
fontTools/ttLib/ttFont.py in _save at line 212
fontTools/ttLib/ttFont.py in save at line 173
Variables at point of error:
formatstring = ">llIIHHQQhhhhHHhhh"
elements = [
65536,
65601,
1208942685,
1594834165,
3,
1000,
3551183604,
3640213847,
-132,
-170.009,
788,
835,
0,
3,
2,
0,
0
]
As you can see the value -170.009
would trigger the error. If integers are expected then rounding should probably be applied.
Issue Analytics
- State:
- Created 4 years ago
- Comments:9 (6 by maintainers)
Top Results From Across the Web
struct.error: required argument is not an integer - Stack Overflow
Stack Overflow for Teams – Start collaborating and sharing organizational knowledge.
Read more >'required argument is not a float' when writing 'data: [x, y ...
I think that the issue is silly. I'd like to run the code on two computers and I need to use a list....
Read more >ToolValidator class—ArcGIS Pro | Documentation
The data type (integer or float) is the same as the first dependent parameter. If the first dependent parameter is a multivalue (a...
Read more >Python Tutorial - Getting Started with Python and Python Basics
Data Types: Python support these data types: int (integers), float (floating-point numbers), str (String), bool (boolean of True or False ), and more....
Read more >Symbolic Expressions - SageMath Documentation
Return the coefficients of this symbolic expression as a polynomial in x. INPUT: x – optional variable. OUTPUT: Depending on the value of...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Sure! On it.
We need to round because head table can only contain integers for the font bounding box values, unlike the CFF FontBBox. I suggest using
fontTools.misc.arrayTools.intRect
function, which takes the floor/ceill thus guaranteeing the rounded rectangle is not smaller than the original. Would you like to work on a pull request for that?