diff --git a/src/displayapp/fonts/CMakeLists.txt b/src/displayapp/fonts/CMakeLists.txt index 1dfe041c..718afafd 100644 --- a/src/displayapp/fonts/CMakeLists.txt +++ b/src/displayapp/fonts/CMakeLists.txt @@ -4,13 +4,16 @@ set(FONTS jetbrains_mono_42 jetbrains_mono_76 jetbrains_mono_bold_20 jetbrains_mono_extrabold_compressed lv_font_navi_80 lv_font_sys_48 open_sans_light) +configure_file(displayapp/fonts/jetbrains_mono_bold_20.c_zero.patch + displayapp/fonts/jetbrains_mono_bold_20.c_zero.patch COPYONLY) foreach(FONT ${FONTS}) - set_source_files_properties(${CMAKE_CURRENT_SOURCE_DIR}/displayapp/fonts/${FONT}.c + set_source_files_properties(displayapp/fonts/${FONT}.c PROPERTIES GENERATED TRUE) - add_custom_command(OUTPUT ${CMAKE_CURRENT_SOURCE_DIR}/displayapp/fonts/${FONT}.c - COMMAND python generate.py -f ${FONT} fonts.json + add_custom_command(OUTPUT displayapp/fonts/${FONT}.c + COMMAND python ${CMAKE_CURRENT_SOURCE_DIR}/displayapp/fonts/generate.py + -f ${FONT} ${CMAKE_CURRENT_SOURCE_DIR}/displayapp/fonts/fonts.json DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/displayapp/fonts/fonts.json - WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/displayapp/fonts + WORKING_DIRECTORY displayapp/fonts ) endforeach() diff --git a/src/displayapp/fonts/generate.py b/src/displayapp/fonts/generate.py index d1756a79..d7785951 100755 --- a/src/displayapp/fonts/generate.py +++ b/src/displayapp/fonts/generate.py @@ -11,6 +11,8 @@ import subprocess class Source(object): def __init__(self, d): self.file = d['file'] + if not os.path.exists(self.file): + self.file = os.path.join(os.path.dirname(sys.argv[0]), self.file) self.range = d.get('range') self.symbols = d.get('symbols')