def main(args=None): opt = parse_options(args) if opt.glyphs is not None: if opt.instances is None: glyphsLib.build_masters(opt.glyphs, opt.masters) else: glyphsLib.build_instances(opt.glyphs, opt.masters, opt.instances)
def build_ufos(self, glyphs_path, interpolate=False): """Build UFOs from Glyphs source.""" master_dir = self._output_dir('ufo') instance_dir = self._output_dir('ufo', is_instance=True) if interpolate: return build_instances(glyphs_path, master_dir, instance_dir) else: return build_masters(glyphs_path, master_dir, designspace_instance_dir=instance_dir)
def build_ufos( self, glyphs_path, interpolate=False, masters_as_instances=False, family_name=None): """Build UFOs from Glyphs source.""" master_dir = self._output_dir('ufo') instance_dir = self._output_dir('ufo', is_instance=True) ufos = [] if not interpolate or masters_as_instances: ufos.extend(build_masters( glyphs_path, master_dir, designspace_instance_dir=instance_dir, family_name=family_name)) if interpolate: ufos.extend(build_instances( glyphs_path, master_dir, instance_dir, family_name=family_name)) return ufos
def test_apply_instance_data(tmpdir): # Goal: test that the existing APIs used by fontmake and possibly others # still work (especially `apply_instance_data`) masters, instances = makeFamily() gasp_table = {'65535': '15', '20': '7', '8': '10'} instances[0].customParameters['GASP Table'] = gasp_table instances[1].customParameters["Don't use Production Names"] = True font = makeFont(masters, instances, 'Exemplary Sans') filename = os.path.join(str(tmpdir), 'font.glyphs') font.save(filename) master_dir = os.path.join(str(tmpdir), 'master_ufos_test') os.mkdir(master_dir) instance_dir = os.path.join(str(tmpdir), 'instance_ufos_test') os.mkdir(instance_dir) ufos = build_instances(filename, master_dir, instance_dir) ufo_range_records = ufos[0].info.openTypeGaspRangeRecords assert ufo_range_records is not None assert len(ufo_range_records) == 3 assert UFO2FT_USE_PROD_NAMES_KEY in ufos[1].lib assert ufos[1].lib[UFO2FT_USE_PROD_NAMES_KEY] == False