def action_ok(self, event): fabric = FontFabric() if self.font_file.name[-3:].lower() == 'pdb': font = fabric.loadPdb(self.font_file, self.encoding.get_selection()) if self.font_file.name[-3:].lower() == 'pft': font = fabric.loadPft(self.font_file, self.encoding.get_selection()) font_name = String(self.font_name.text).replaceAll(' ', '') font.name = font_name font_file = c.config('FONT_DIRECTORY') + '/' + font_name o = ObjectOutputStream(FileOutputStream(font_file)) o.writeObject(font) o.close() self.dispose() self.parent.refresh_fonts()
def action_ok(self, event): fabric = FontFabric() if self.rb_normal.selected: font = fabric.loadNormal(self.font, self.encoding.get_selection()) elif self.rb_antialiased.selected: font = fabric.loadAntialiased(self.font, self.encoding.get_selection()) elif self.rb_subpixel.selected: font = fabric.loadSubpixel(self.font, self.encoding.get_selection()) elif self.rb_subpixel_aa.selected: font = fabric.loadSubpixelAntialiased(self.font, self.encoding.get_selection()) font_name = String(self.font_name.text).replaceAll(' ', '') font.name = font_name font_file = c.config('FONT_DIRECTORY') + '/' + font_name o = ObjectOutputStream(FileOutputStream(font_file)) o.writeObject(font) o.close() self.dispose() self.parent.refresh_fonts()