fontgen: remove .c from requested font if there
This commit is contained in:
parent
1d4fd9c27f
commit
a75912dd97
|
@ -45,10 +45,13 @@ def main():
|
||||||
fonts_to_run = set(data['fonts'].keys())
|
fonts_to_run = set(data['fonts'].keys())
|
||||||
|
|
||||||
if args.font:
|
if args.font:
|
||||||
d = set(args.font).difference(fonts_to_run)
|
enabled_fonts = set()
|
||||||
|
for font in args.font:
|
||||||
|
enabled_fonts.add(font[:-2] if font.endswith('.c') else font)
|
||||||
|
d = enabled_fonts.difference(fonts_to_run)
|
||||||
if d:
|
if d:
|
||||||
print(f'Warning: requested font{"s" if len(d)>1 else ""} missing: {" ".join(d)}')
|
print(f'Warning: requested font{"s" if len(d)>1 else ""} missing: {" ".join(d)}')
|
||||||
fonts_to_run = fonts_to_run.intersection(set(args.font))
|
fonts_to_run = fonts_to_run.intersection(enabled_fonts)
|
||||||
|
|
||||||
for name in fonts_to_run:
|
for name in fonts_to_run:
|
||||||
font = data['fonts'][name]
|
font = data['fonts'][name]
|
||||||
|
|
Loading…
Reference in a new issue