cu2qu/cli: latest ufoLib2 no longer does Font(path); must use Font.open(path)
https://github.com/fonttools/fonttools/runs/4211314586?check_suite_focus=true#step:5:598
This commit is contained in:
parent
2e6b010834
commit
0dc2f820bd
@ -29,8 +29,14 @@ def _cpu_count():
|
|||||||
return 1
|
return 1
|
||||||
|
|
||||||
|
|
||||||
|
def open_ufo(path):
|
||||||
|
if hasattr(ufo_module.Font, "open"): # ufoLib2
|
||||||
|
return ufo_module.Font.open(path)
|
||||||
|
return ufo_module.Font(path) # defcon
|
||||||
|
|
||||||
|
|
||||||
def _font_to_quadratic(input_path, output_path=None, **kwargs):
|
def _font_to_quadratic(input_path, output_path=None, **kwargs):
|
||||||
ufo = ufo_module.Font(input_path)
|
ufo = open_ufo(input_path)
|
||||||
logger.info('Converting curves for %s', input_path)
|
logger.info('Converting curves for %s', input_path)
|
||||||
if font_to_quadratic(ufo, **kwargs):
|
if font_to_quadratic(ufo, **kwargs):
|
||||||
logger.info("Saving %s", output_path)
|
logger.info("Saving %s", output_path)
|
||||||
@ -152,7 +158,7 @@ def main(args=None):
|
|||||||
|
|
||||||
if options.interpolatable:
|
if options.interpolatable:
|
||||||
logger.info('Converting curves compatibly')
|
logger.info('Converting curves compatibly')
|
||||||
ufos = [ufo_module.Font(infile) for infile in options.infiles]
|
ufos = [open_ufo(infile) for infile in options.infiles]
|
||||||
if fonts_to_quadratic(ufos, **kwargs):
|
if fonts_to_quadratic(ufos, **kwargs):
|
||||||
for ufo, output_path in zip(ufos, output_paths):
|
for ufo, output_path in zip(ufos, output_paths):
|
||||||
logger.info("Saving %s", output_path)
|
logger.info("Saving %s", output_path)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user