Exemplo n.º 1
0
 def saveOTF(self, filename):
     try:
         self.font.save(filename)
         ttfont = TTFont(filename)
         featurefile = UnicodeIO(self.fontfeatures.asFea())
         builder = Builder(ttfont, featurefile)
         catmap = {"base": 1, "ligature": 2, "mark": 3, "component": 4}
         for g in self.font:
             if g.category in catmap:
                 builder.setGlyphClass_(None, g.name, catmap[g.category])
         builder.build()
         ttfont.save(filename)
     except Exception as e:
         print(e)
         return str(e)