I am working on a tool to remove unused glyphs from the font files associated with various string tables, I am manually parsing the XMLNodes in the ttx file using C#. But I am bumping into a headache when attempting to recompile the ttf.
The program pulls a list of unicode values for all the glyphs meant to be removed from the font file, generated by another tool, and searched through the CMap section to determine the correct Unicode to name mappings, I then use that information to parse the entire document searching for all the names I have found, and remove the nodes from the file.
I then parse the GlyphOrder section by pulling the entire entry into a list and remove all the unused codes. I then write the nodes back to the file using the same format in the original file, Writing new IDs as indices in the List.
I also update the numGlyphs value in maxp.
I am getting this error when recompiling the TTF:
Parsing 'vmtx' table...
Traceback (most recent call last):
File "fontTools\ttx.pyc", line 243, in main
File "fontTools\ttx.pyc", line 228, in process
File "fontTools\ttx.pyc", line 164, in ttCompile
File "fontTools\ttLib\__init__.pyc", line 163, in save
File "fontTools\ttLib\__init__.pyc", line 512, in _writeTable
File "fontTools\ttLib\__init__.pyc", line 524, in getTableData
File "fontTools\ttLib\tables\_c_m_a_p.pyc", line 46, in compile
File "fontTools\ttLib\tables\_c_m_a_p.pyc", line 426, in compile
Any assistance would be appreciated.