fix: language in generation script + adjust width
Browse files
generate_font_sample_image.py
CHANGED
|
@@ -10,7 +10,7 @@ font_list, exclusion_rule = load_fonts()
|
|
| 10 |
font_list: List[DSFont] = list(filter(lambda x: not exclusion_rule(x), font_list))
|
| 11 |
font_list.sort(key=lambda x: x.path)
|
| 12 |
|
| 13 |
-
width =
|
| 14 |
height = 150
|
| 15 |
font_size = 32
|
| 16 |
|
|
@@ -20,9 +20,11 @@ def sample_text(font: DSFont) -> str:
|
|
| 20 |
return "こんにちは、世界\nフォント識別\nHello, world"
|
| 21 |
if font.language == "ko":
|
| 22 |
return "안녕하세요, 세계\n글꼴 인식하기\nHello, world"
|
| 23 |
-
if font.language == "zh
|
|
|
|
|
|
|
| 24 |
return "你好,世界\n字体识别\nHello, world"
|
| 25 |
-
if font.language
|
| 26 |
return "你好,世界\n字型辨識\nHello, world"
|
| 27 |
return "CJK字体\nCJKフォント\nCJK 글꼴"
|
| 28 |
|
|
|
|
| 10 |
font_list: List[DSFont] = list(filter(lambda x: not exclusion_rule(x), font_list))
|
| 11 |
font_list.sort(key=lambda x: x.path)
|
| 12 |
|
| 13 |
+
width = 320
|
| 14 |
height = 150
|
| 15 |
font_size = 32
|
| 16 |
|
|
|
|
| 20 |
return "こんにちは、世界\nフォント識別\nHello, world"
|
| 21 |
if font.language == "ko":
|
| 22 |
return "안녕하세요, 세계\n글꼴 인식하기\nHello, world"
|
| 23 |
+
if font.language == "zh":
|
| 24 |
+
return "你好,世界\n字体识别 字型辨識\nHello, world"
|
| 25 |
+
if str(font.language).startswith("zh-Hans"):
|
| 26 |
return "你好,世界\n字体识别\nHello, world"
|
| 27 |
+
if str(font.language).startswith("zh-Hant"):
|
| 28 |
return "你好,世界\n字型辨識\nHello, world"
|
| 29 |
return "CJK字体\nCJKフォント\nCJK 글꼴"
|
| 30 |
|