예제 #1
1
파일: hspace.py 프로젝트: hblackett/hTools2
 def rename_glyphs(self, names_list):
     print "renaming glyphs in space...\n"
     for ufo_path in self.ufos():
         ufo = RFont(ufo_path, showUI=False)
         print "\trenaming glyphs in %s..." % get_full_name(ufo)
         rename_glyphs_from_list(ufo, names_list, overwrite=True, mark=False, verbose=False)
         ufo.save()
     print
     print "...done.\n"
 def apply_callback(self, sender):
     _overwrite = self.w._overwrite.get()
     _mark = self.w._mark.get()
     # the apply button was pressed before getting the list file
     if not self.list_path:
         print 'please get a names list first.\n'
         return
     f = CurrentFont()
     if f is not None:
         names_list = read_names_list_from_file(self.list_path)
         if len(names_list) > 0:
             rename_glyphs_from_list(f, names_list, overwrite=_overwrite, mark=_mark)
         # no glyph selected
         else:
             print no_glyph_selected
     # no font open
     else:
         print no_font_open
예제 #3
0
 def apply_callback(self, sender):
     _overwrite = self.w._overwrite.get()
     _mark = self.w._mark.get()
     # the apply button was pressed before getting the list file
     if not self.list_path:
         print 'please get a names list first.\n'
         return
     f = CurrentFont()
     if f is not None:
         names_list = read_names_list_from_file(self.list_path)
         if len(names_list) > 0:
             rename_glyphs_from_list(f, names_list, overwrite=_overwrite, mark=_mark)
         # no glyph selected
         else:
             print no_glyph_selected
     # no font open
     else:
         print no_font_open