summaryrefslogtreecommitdiff
path: root/src/displayapp
diff options
context:
space:
mode:
authorYehoshua Pesach Wallach <yehoshuapw@gmail.com>2022-04-19 14:53:57 +0300
committerJF <JF002@users.noreply.github.com>2022-05-10 22:20:02 +0200
commit9535c1e651175ca9a3eeef35f463b212e536ded8 (patch)
treeefbbdf88b84a252a7fd4c696cab53eec9d8968d0 /src/displayapp
parentac0dc5ff4790f83c972387c3ef4d7e55611643ce (diff)
fontgen: move features into fonts
Also, removed feature existance cheking (since it now depends on a font, so may end up being inside (only) a font not being used currently - which is an allowed usage)
Diffstat (limited to 'src/displayapp')
-rw-r--r--src/displayapp/fonts/fonts.json20
-rw-r--r--src/displayapp/fonts/generate.py14
2 files changed, 13 insertions, 21 deletions
diff --git a/src/displayapp/fonts/fonts.json b/src/displayapp/fonts/fonts.json
index c1ff9594..6873185b 100644
--- a/src/displayapp/fonts/fonts.json
+++ b/src/displayapp/fonts/fonts.json
@@ -13,7 +13,15 @@
],
"bpp": 1,
"size": 20,
- "patches": ["./fix_jetbrains_mono_bold_20_zero.py"]
+ "patches": ["./fix_jetbrains_mono_bold_20_zero.py"],
+ "features": {
+ "hebrew": [
+ {
+ "font": "SimpleCLM-Medium.ttf",
+ "range": "0x05D0-0x05EA,0x05F3,0x05F4"
+ }
+ ]
+ }
},
"jetbrains_mono_42": {
"sources": [
@@ -76,15 +84,5 @@
"size": 80,
"compress": true
}
- },
- "features": {
- "hebrew": {
- "jetbrains_mono_bold_20": [
- {
- "font": "SimpleCLM-Medium.ttf",
- "range": "0x05D0-0x05EA,0x05F3,0x05F4"
- }
- ]
- }
}
}
diff --git a/src/displayapp/fonts/generate.py b/src/displayapp/fonts/generate.py
index 380ff3d4..d0ae8dee 100644
--- a/src/displayapp/fonts/generate.py
+++ b/src/displayapp/fonts/generate.py
@@ -43,10 +43,6 @@ def main():
with open(args.config, 'r') as fd:
data = json.load(fd)
- for enabled_feature in args.features:
- if enabled_feature not in data['features']:
- sys.exit(f'Error: the requested feature {enabled_feature} does not exist in {args.config}.')
-
fonts_to_run = args.font
if args.removec and args.font:
fonts_to_run = []
@@ -66,13 +62,11 @@ def main():
if fonts_to_run and name not in fonts_to_run:
continue
sources = font.pop('sources')
- if 'patches' in font:
- patches = font.pop('patches')
- else:
- patches = None
+ patches = font.pop('patches') if 'patches' in font else []
+ features = font.pop('features') if 'features' in font else []
for enabled_feature in args.features:
- if name in data['features'][enabled_feature]:
- sources.extend(data['features'][enabled_feature][name])
+ if enabled_feature in features:
+ sources.extend(features[enabled_feature])
font['fonts'] = [FontArg(thing) for thing in sources]
line = gen_lvconv_line(f'{name}.c', **font)
subprocess.check_call(line)