Use the same font all the way for a specific language

This commit is contained in:
Raphael Coeffic
2021-05-08 08:40:02 +02:00
parent 3f64afaa5c
commit aeb297c800
4 changed files with 30 additions and 24 deletions
+3 -1
View File
@@ -9,6 +9,8 @@ standard_chars = """ !"#$%&'()*+,-./0123456789:;<=>?°ABCDEFGHIJKLMNOPQRSTUVWXYZ
extra_chars = "".join([chr(0x10000+i) for i in range(21)])
def is_cjk_char(c):
return 0x4E00 <= ord(c) <= 0x9FFF
def cjk_chars(lang):
charset = set()
@@ -16,7 +18,7 @@ def cjk_chars(lang):
with open(os.path.join(tools_path, "../radio/src/translations/%s.h.txt" % lang), encoding='utf-8') as f:
data = f.read()
for c in data:
if 0x4E00 <= ord(c) <= 0x9FFF:
if is_cjk_char(c):
charset.add(c)
# print(ord(c))
result = list(charset)