question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Float yMin value: required argument is not an integer

See original GitHub issue

If 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:closed
  • Created 4 years ago
  • Comments:9 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
PeterDekkerscommented, May 9, 2019

Sure! On it.

0reactions
anthrotypecommented, May 9, 2019

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?

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found