SOLVED Feature Preview Error: required argument is not an integer



  • Hi there,

    I got a font that generates well but when I use Feature Preview I get the following error:

    Traceback (most recent call last):
      File "featurePreview.py", line 424, in _compileFeatureFont
      File "featurePreview.py", line 53, in __init__
      File "featurePreview.py", line 85, in buildBinaryFont
      File "/Applications/RoboFont.app/Contents/Resources/lib/python3.7/fontTools/fontBuilder.py", line 352, in save
      File "/Applications/RoboFont.app/Contents/Resources/lib/python3.7/fontTools/ttLib/ttFont.py", line 172, in save
      File "/Applications/RoboFont.app/Contents/Resources/lib/python3.7/fontTools/ttLib/ttFont.py", line 211, in _save
      File "/Applications/RoboFont.app/Contents/Resources/lib/python3.7/fontTools/ttLib/ttFont.py", line 632, in _writeTable
      File "/Applications/RoboFont.app/Contents/Resources/lib/python3.7/fontTools/ttLib/ttFont.py", line 650, in getTableData
      File "/Applications/RoboFont.app/Contents/Resources/lib/python3.7/fontTools/ttLib/tables/_h_e_a_d.py", line 83, in compile
      File "/Applications/RoboFont.app/Contents/Resources/lib/python3.7/fontTools/misc/sstruct.py", line 74, in pack
    struct.error: required argument is not an integer
    

    Any ideas what that might be triggered by?



  • Wait, I did run your script to make sure but looking at fontinfo.plist I find that the value is unchanged and still not an integer:

    <real>1000.0</real>
    

    Changing it manually to

    <integer>1000</integer>
    

    does the trick!



  • Hi @frederik, thanks for looking into this but the problem persists, the value had been an integer. Any other likely candidates? (I (visually) looked and could not find any floats except for version in font info.)


  • admin


  • admin

    a wild guess: your units per em is a float (a number with a decimal) instead of an integer

    f = CurrentFont()
    f.info.unitsPerEm = int(round(f.info.unitsPerEm))
    

Log in to reply