feat: 添加古风官职字符到字体子集
- 添加破折号(—) - 添加庶民、太尉等特殊字符 - 字体大小增加3KB(757KB → 760KB)
This commit is contained in:
1 parent
0e17553a19
commit
5a00965c1a
9 files changed
+504
-4
No files matched your search
@@ -0,0 +1,90 @@
|
||||
#!/usr/bin/env python3
|
||||
"""
|
||||
检查古风官职文本中的新字符
|
||||
"""
|
||||
|
||||
# 古风官职文本
|
||||
ancient_text = """正一品
|
||||
太师
|
||||
2000
|
||||
从一品
|
||||
太尉
|
||||
1400
|
||||
正二品
|
||||
参知政事
|
||||
1050
|
||||
从二品
|
||||
节度使
|
||||
800
|
||||
正三品
|
||||
御史中丞
|
||||
600
|
||||
从三品
|
||||
秘书监
|
||||
480
|
||||
正四品
|
||||
谏议大夫
|
||||
380
|
||||
从四品
|
||||
侍读学士
|
||||
300
|
||||
正五品
|
||||
给事中
|
||||
240
|
||||
从五品
|
||||
知州
|
||||
190
|
||||
正六品
|
||||
侍御史
|
||||
150
|
||||
从六品
|
||||
通判
|
||||
115
|
||||
正七品
|
||||
知县
|
||||
85
|
||||
从七品
|
||||
殿中侍御史
|
||||
60
|
||||
正八品
|
||||
大理评事
|
||||
40
|
||||
从八品
|
||||
录事参军
|
||||
25
|
||||
正九品
|
||||
主簿
|
||||
15
|
||||
从九品
|
||||
司户参军
|
||||
5
|
||||
—
|
||||
庶民
|
||||
0"""
|
||||
|
||||
# 提取所有唯一字符
|
||||
ancient_chars = set(ancient_text)
|
||||
|
||||
# 读取现有字符
|
||||
with open("themes/Ying/static/font/used_chars.txt", 'r', encoding='utf-8') as f:
|
||||
existing_chars = set(f.read())
|
||||
|
||||
# 找出新字符
|
||||
new_chars = ancient_chars - existing_chars
|
||||
|
||||
print(f"📊 古风文本总字符数: {len(ancient_chars)}")
|
||||
print(f"📊 现有字符数: {len(existing_chars)}")
|
||||
print(f"📊 新字符数: {len(new_chars)}")
|
||||
|
||||
if new_chars:
|
||||
print(f"\n✅ 需要添加的新字符:")
|
||||
for char in sorted(new_chars):
|
||||
print(f" '{char}' (U+{ord(char):04X})")
|
||||
|
||||
# 添加新字符到现有字符列表
|
||||
with open("themes/Ying/static/font/used_chars.txt", 'a', encoding='utf-8') as f:
|
||||
f.write(''.join(sorted(new_chars)))
|
||||
|
||||
print(f"\n✅ 已添加 {len(new_chars)} 个新字符到 used_chars.txt")
|
||||
else:
|
||||
print("\n✅ 没有新字符需要添加(所有字符都已存在)")
|
||||
Reference in new issue
Block a user