def families_glyphs_all(family_before, family_after, uuid): """Dump every glyph for each font in family_before. This diff is useful to see whether family_after can access all the glyphs in family_before """ styles_before = {s.name: s for f in family_before.fonts for s in f.styles} styles_after = {s.name: s for f in family_after.fonts for s in f.styles} shared_styles = set(styles_before) & set(styles_after) items = [] for style in shared_styles: font_a = styles_before[style].font.font font_b = styles_after[style].font.font all_glyphs = { 'uuid': uuid, 'title': 'Glyph All', 'view': 'glyphs_all', 'font_before': styles_before[style].name, 'font_after': styles_after[style].name, 'items': dump_glyphs(styles_before[style].font.font)._data, } items.append(all_glyphs) return list(map(_diff_serialiser, items))
def recalc_tables(self): """Recalculate DFont tables""" self.recalc_glyphset() anchors = DumpAnchors(self) self.glyphs = dump_glyphs(self) self.marks = anchors.marks_table self.mkmks = anchors.mkmks_table self.attribs = dump_attribs(self) self.names = dump_nametable(self) self.kerns = dump_kerning(self) self.metrics = dump_glyph_metrics(self)