pre-process fonts for raylib (#36489)

* pre-process fonts for raylib

* it's fast!

* raylib processing

* build with scons

* padding

* happy ruff

* all exported

* cleanup

* more pad
This commit is contained in:
Adeeb Shihadeh
2025-10-26 13:20:11 -07:00
committed by GitHub
parent 03cb3e9dc0
commit 0d4b0ee116
4 changed files with 154 additions and 52 deletions
+16
View File
@@ -1,7 +1,23 @@
import os
import re
import json
from pathlib import Path
Import('env', 'arch', 'common')
# build the fonts
generator = File("#selfdrive/assets/fonts/process.py")
source_files = Glob("#selfdrive/assets/fonts/*.ttf") + Glob("#selfdrive/assets/fonts/*.otf")
output_files = [
(f.abspath.split('.')[0] + ".fnt", f.abspath.split('.')[0] + ".png")
for f in source_files
if "NotoColor" not in f.name
]
env.Command(
target=output_files,
source=[generator, source_files],
action=f"python3 {generator}",
)
# compile gettext .po -> .mo translations
with open(File("translations/languages.json").abspath) as f:
languages = json.loads(f.read())