From 237a15e04946b363b4c5999e430bbf64aa98dffa Mon Sep 17 00:00:00 2001 From: fvanroie <15969459+fvanroie@users.noreply.github.com> Date: Sat, 17 Jul 2021 19:55:14 +0200 Subject: [PATCH] Update hasp_font_create.py --- tools/hasp_font_create.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/tools/hasp_font_create.py b/tools/hasp_font_create.py index 596a84fb..9d0f41c8 100644 --- a/tools/hasp_font_create.py +++ b/tools/hasp_font_create.py @@ -68,10 +68,11 @@ for (item, data) in fonts.items(): contents[13] = contents[13].replace(" 1", " 0 // default to off") contents.insert(0, "/* clang-format off */\n") # Add c-lang directive - - for line in contents: - if (line =="#if LV_VERSION_CHECK(7, 4, 0)"): - line = "#if LV_VERSION_CHECK(7, 4, 0) || LV_VERSION_CHECK(8, 0, 0)" + + for idx,line in enumerate(contents): + if "#if LV_VERSION_CHECK(7, 4, 0)" in line: + contents[idx] = "#if LV_VERSION_CHECK(7, 4, 0) || LV_VERSION_CHECK(8, 0, 0)\r" + print(line) with open(output, "w", encoding="utf8") as f: contents = "".join(contents)