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()