def apply_callback(self, sender): mode = self.w.print_mode.get() sort_names = self.w.sort_names.get() font = CurrentFont() if font is not None: glyph_names = get_glyphs(font) if len(glyph_names): print_selected_glyphs(font, mode, sort=sort_names) # no glyph selected else: print no_glyph_selected # no font open else: print no_font_open
# [h] print selected glyphs '''Print the names of the selected glyphs as plain text or Python list..''' # import try: from mojo.roboFont import CurrentFont except: from robofab.world import CurrentFont from hTools2.modules.fontutils import print_selected_glyphs # settings # mode=0 : list of Python strings # mode=1 : plain list with linebreaks _mode = 0 # run font = CurrentFont() print_selected_glyphs(font, mode=_mode)