def apply(self, override_origin=False): from ttfont import Font ymin = 0 ymax = 0 for f in self.fonts: metrics = Font(f) font_ymin, font_ymax = metrics.get_bounding() ymin = min(font_ymin, ymin) ymax = max(font_ymax, ymax) for f in self.fonts: fixer = VmetFixer(self.testcase, f) fixer.apply(ymin, ymax, override_origin=override_origin) command = "$ {0} {1}".format(Vmet.SCRIPTPATH, ' '.join(self.fonts)) logger.debug(command) import StringIO for l in StringIO.StringIO(metricview(self.fonts)): logger.debug(l)
def fix(self): for name in self.font['name'].names: title = Font.bin2unistring(name) title = CharacterSymbolsFixer.normalizestr(title) name.string = title.encode(name.getEncoding()) return True