Exemplo n.º 1
0
 def generate_vfbs(self, masters=True, instances=False, interpol=False):
     """Batch convert ufos in project to vfb format."""
     # collect files
     _ufos = []
     if masters:
         _ufos += self.masters()
     if instances:
         _ufos += self.instances()
     if interpol:
         _ufos += self.masters_interpol()
     # run
     for ufo in _ufos:
         _vfb_name = os.path.split(ufo)[1]
         _vfb_file = "%s.vfb" % _vfb_name.split(".")[0]
         _vfb_path = os.path.join(self.paths["vfbs"], _vfb_file)
         font = NewFont()
         font.readUFO(ufo, doProgress=True)
         font.save(_vfb_path)
         font.close()
Exemplo n.º 2
0
 def generate_vfbs(self, masters=True, instances=False, interpol=False):
     '''Batch convert ufos in project to vfb format.'''
     import os
     from robofab.world import NewFont
     # collect files
     _ufos = []
     if masters:
         _ufos += self.masters()
     if instances:
         _ufos += self.instances()
     if interpol:
         _ufos += self.masters_interpol()
     # run
     for ufo in _ufos:
         _vfb_name = os.path.split(ufo)[1]
         _vfb_file = '%s.vfb' % _vfb_name.split('.')[0]
         _vfb_path = os.path.join(self.paths['vfbs'], _vfb_file)
         font = NewFont()
         font.readUFO(ufo, doProgress=True)
         font.save(_vfb_path)
         font.close()