1 # -*- coding: utf-8 -*-
3 # Author: mshio <mshio@users.sourceforge.jp>
8 from types import MethodType
13 An object in order to parse the characters in the specified font.
15 def __init__(self, font_path):
16 self.forge = fontforge.open(font_path)
18 def parse(self, method):
19 self.proc = MethodType(method, self, FontParser)
22 if g[0] != '.' and f[g].unicode > 0:
26 def __init__(self, old_font_path, new_font_path):
27 self.font_path = [old_font_path, new_font_path]
31 old = fontforge.open(self.font_path[0])
33 def collect(self, glyph_obj):
34 if glyph_obj.glyphname not in old:
35 buf.append(glyph_obj.unicode)
37 FontParser(self.font_path[1]).parse(collect)