def testUFOVersusGlifImport(self): font = NewFont() font.readUFO(getDemoFontPath(), doProgress=False) d1 = getDigests(font) font.close(False) font = NewFont() importAllGlifFiles(font.naked(), getDemoFontGlyphSetPath(), doProgress=False) d2 = getDigests(font) self.assertEqual(d1, d2) font.close(False)
"""Collect paths for all ufos in dir. Check for nested dirs. Optionally, select only ufos which match a filter string. """ ufo = [] names = os.listdir(dir) for n in names: p = os.path.join(dir, n) if n[-4:] == ".ufo": if filter is not None: if dir.find(filter) <> -1: ufo.append(p) else: ufo.append(p) continue if os.path.isdir(p): ufo += globUFO(p, filter) return ufo dir = GetFolder() ufo = globUFO(dir) for path in ufo: font = NewFont() font.readUFO(path, doProgress=True) font.update() vfbPath = path[:-4] + ".vfb" font.save(vfbPath) print 'DONE!'
def globUFO(dir, filter=None): """Collect paths for all ufos in dir. Check for nested dirs. Optionally, select only ufos which match a filter string. """ ufo = [] names = os.listdir(dir) for n in names: p = os.path.join(dir, n) if n[-4:] == ".ufo": if filter is not None: if dir.find(filter) <> -1: ufo.append(p) else: ufo.append(p) continue if os.path.isdir(p): ufo += globUFO(p, filter) return ufo dir = GetFolder() ufo = globUFO(dir) for path in ufo: font = NewFont() font.readUFO(path, doProgress=True) font.update() vfbPath = path[:-4] + ".vfb" font.save(vfbPath) print 'DONE!'