mirror of
https://github.com/MoreTore/openpilot.git
synced 2026-08-21 16:13:47 +08:00
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:
@@ -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())
|
||||
|
||||
Reference in New Issue
Block a user