Problem with ttx/fonttools: turning ttx back into ttf

I have a problem turning ttx back into ttf (ttf to ttx works ). Even if I'm not changing anything in the ttx file there is a problem compiling the ttf from it. Does anyone know what the issue might be? Help would be very much appreciated.

Issue seems to be related to "PUSHB",
ValueError: too many values to unpack

Parsing 'fpgm' table...
Traceback (most recent call last):
  File "/usr/local/bin/ttx", line 11, in <module>
    ttx.main(sys.argv[1:])
  File "/Library/Python/2.7/site-packages/FontTools/fontTools/ttx.py", line 310, in main
    process(jobs, options)
  File "/Library/Python/2.7/site-packages/FontTools/fontTools/ttx.py", line 295, in process
    action(input, output, options)
  File "/Library/Python/2.7/site-packages/FontTools/fontTools/ttx.py", line 216, in ttCompile
    ttf.importXML(input, quiet=options.quiet)
  File "/Library/Python/2.7/site-packages/FontTools/fontTools/ttLib/__init__.py", line 342, in importXML
    reader.read()
  File "/Library/Python/2.7/site-packages/FontTools/fontTools/misc/xmlReader.py", line 30, in read
    self._parseFile(file)
  File "/Library/Python/2.7/site-packages/FontTools/fontTools/misc/xmlReader.py", line 49, in _parseFile
    parser.Parse(chunk, 0)
  File "/Library/Python/2.7/site-packages/FontTools/fontTools/misc/xmlReader.py", line 115, in _endElementHandler
    self.currentTable.fromXML(name, attrs, content, self.ttFont)
  File "/Library/Python/2.7/site-packages/FontTools/fontTools/ttLib/tables/_f_p_g_m.py", line 22, in fromXML
    program.fromXML(name, attrs, content, ttFont)
  File "/Library/Python/2.7/site-packages/FontTools/fontTools/ttLib/tables/ttProgram.py", line 264, in fromXML
    self._assemble()
  File "/Library/Python/2.7/site-packages/FontTools/fontTools/ttLib/tables/ttProgram.py", line 351, in _assemble
    op, argBits = streamMnemonicDict["PUSHB"]
ValueError: too many values to unpack


Comments

  • What version of foottools do you have? We changed something about his to days ago. And it seems I forgot to commit a few lines of code. I just fixed it, it will be live soon.
  • Hi Georg, I've tried various (under Mac OS 10.9.5). The thing is that it did work fine two days ago. Could you pin point me to where I'd need to go to get the fixed version?
    https://github.com/behdad/fonttools ?

    (I've just now reinstalled all the contents (including fonttools of course) from RoboFab_599, from here http://download.robofab.com/ but that does not work either, same problem, related I guess)
  • Martin, is the problem related to one particular ttf? One possible workaround could be to only output the tables you want to change by using ttx -t <table>, and then merge them into the ttf again.
  • This is fixed now. Please get the latest version from GitHub.
  • Georg, thanks, it’s working again.

    Paul, thanks for your input, that would have been a possible option.