mirror of
https://github.com/trezor/trezor-firmware.git
synced 2024-12-23 06:48:16 +00:00
b5ea26eb7a
Introduce a new flag `_NAME` for each font and reduce the usage of `_ENABLE` flag to purely compilation guard. [no changelog]
20 lines
599 B
Python
20 lines
599 B
Python
from __future__ import annotations
|
|
|
|
|
|
def add_font(
|
|
font_name: str,
|
|
font: str | None,
|
|
defines: list[str | tuple[str, str]],
|
|
sources: list[str],
|
|
) -> None:
|
|
if font is not None:
|
|
font_filename = font.replace("_upper", "").lower()
|
|
defines += [
|
|
f"TREZOR_FONT_{font_name}_ENABLE",
|
|
(f"TREZOR_FONT_{font_name}_NAME", font),
|
|
(f"TREZOR_FONT_{font_name}_INCLUDE", f'"{font_filename}.h"'),
|
|
]
|
|
sourcefile = "embed/gfx/fonts/" + font_filename + ".c"
|
|
if sourcefile not in sources:
|
|
sources.append(sourcefile)
|