(bpp, size, font_file: str, symbols: list, output: str)
| 9 | print(f"{filename} already exists, skipping download.") |
| 10 | |
| 11 | def generate(bpp, size, font_file: str, symbols: list, output: str): |
| 12 | output_file_name = f"{output}_{size}.c" |
| 13 | output_path = os.path.join("..", "source-fonts", output_file_name) |
| 14 | print(f"Generating {output_file_name}") |
| 15 | cmd = "lv_font_conv --no-compress --no-prefilter --bpp {} --size {} --font {} -r {} --format lvgl -o {} --force-fast-kern-format".format(bpp, size, font_file, ",".join(symbols), output_path) |
| 16 | ret = os.system(cmd) |
| 17 | if ret != 0: |
| 18 | raise RuntimeError(f"Font generation failed for {output_file_name} (exit code {ret})") |
| 19 | |
| 20 | def read_code_points_map(file_path: str): |
| 21 | codepoints = {} |
no test coverage detected