2024-09-26 10:03:59 +00:00
|
|
|
from __future__ import annotations
|
|
|
|
|
|
|
|
|
|
|
|
def add_font(
|
2024-11-21 10:55:05 +00:00
|
|
|
font_name: str,
|
|
|
|
font: str | None,
|
|
|
|
defines: list[str | tuple[str, str]],
|
|
|
|
sources: list[str],
|
2024-09-26 10:03:59 +00:00
|
|
|
) -> None:
|
|
|
|
if font is not None:
|
|
|
|
font_filename = font.replace("_upper", "").lower()
|
|
|
|
defines += [
|
2024-09-18 10:12:07 +00:00
|
|
|
f"TREZOR_FONT_{font_name}_ENABLE",
|
|
|
|
(f"TREZOR_FONT_{font_name}_NAME", font),
|
2024-11-21 10:55:05 +00:00
|
|
|
(f"TREZOR_FONT_{font_name}_INCLUDE", f'"{font_filename}.h"'),
|
2024-09-26 10:03:59 +00:00
|
|
|
]
|
2024-11-15 09:07:01 +00:00
|
|
|
sourcefile = "embed/gfx/fonts/" + font_filename + ".c"
|
2024-09-26 10:03:59 +00:00
|
|
|
if sourcefile not in sources:
|
|
|
|
sources.append(sourcefile)
|