From a75912dd978e7ed7d35f49b59b97d3c2e5e0e5e4 Mon Sep 17 00:00:00 2001 From: Yehoshua Pesach Wallach Date: Tue, 19 Apr 2022 18:05:03 +0300 Subject: [PATCH] fontgen: remove .c from requested font if there --- src/displayapp/fonts/generate.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/displayapp/fonts/generate.py b/src/displayapp/fonts/generate.py index 994464f9..a6853696 100644 --- a/src/displayapp/fonts/generate.py +++ b/src/displayapp/fonts/generate.py @@ -45,10 +45,13 @@ def main(): fonts_to_run = set(data['fonts'].keys()) 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: 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: font = data['fonts'][name]