import defcon # Load the font font = defcon.Font("MyFont.ufo") # Access the glyph data for the "A" character glyph = font["A"] # Print the number of contours in the glyph print(len(glyph.contours))
import defcon from fontTools.ttLib import TTFont # Load the UFO font ufo = defcon.Font("MyFont.ufo") # Generate the TTF font ttf = ufo.generate("TTF") # Save the TTF font ttf.save("MyFont.ttf")The Defcon library is an open-source package available on the Python Package Index (PyPI).