Hi! I wonder if anyone here could please help to understand how to modify the CFF table with fonttools?
I use it to make demo fonts out of otfs, which includes adding a “demo” suffix into the names. The Name table is easy, but apparently the CFF table also has fontName which needs to match the PostScript name. I can’t wrap my head around how to modify that one, it doesn’t have a built-in function like setName. Tried this:
font = TTFont(path)
font['CFF '].cff.fontNames[0] = 'newName-Light'
font.save(new_path) # This saves a new file but the name change is ignored
# This breaks the file so that even Font Table Viewer can’t open it:
with open(new_path, 'wb') as file_handle:
font['CFF '].cff.compile(file_handle, font, isCFF2=None)
Side question: the specs says that “CFF2 is a successor to and refinement of the 'CFF ’ table” and it’s almost 10 years old now — why does Glyphs outputs CFF rather than CFF2?