UP 支持直接字符配置

This commit is contained in:
jixishi
2024-07-05 23:09:54 +08:00
parent 7eb0f5e1f7
commit 3dd423da77
8 changed files with 180 additions and 72 deletions

View File

@@ -111,14 +111,14 @@ def format_chinese_array_as_text(chinese_array, size):
text_output += '\n '.join(bytes_lines)
text_output += ",\n }\n },\n"
text_output += "};\n\n"
# text_output += "Chinese_t* find_chinese_data(uint8_t unicode_high, uint8_t unicode_low) {\n"
# text_output += " for (int i = 0; i < sizeof(Hzk) / sizeof(Chinese_t); ++i) {\n"
# text_output += " if (Hzk[i].unicode[0] == unicode_high && Hzk[i].unicode[1] == unicode_low) {\n"
# text_output += " return &Hzk[i];\n"
# text_output += " }\n"
# text_output += " }\n"
# text_output += " return NULL;\n"
# text_output += "}\n"
text_output += "Chinese_t* find_chinese_data(uint8_t unicode_high, uint8_t unicode_low) {\n"
text_output += " for (int i = 0; i < sizeof(Hzk) / sizeof(Chinese_t); ++i) {\n"
text_output += " if (Hzk[i].unicode[0] == unicode_high && Hzk[i].unicode[1] == unicode_low) {\n"
text_output += " return &Hzk[i];\n"
text_output += " }\n"
text_output += " }\n"
text_output += " return NULL;\n"
text_output += "}\n"
text_output += "\n#endif //HW_LIB_OLED_FONT_CHUC_H"
return text_output