This commit is contained in:
恍兮惚兮 2024-11-15 17:32:41 +08:00
parent ddaa953765
commit 735703aa4c
2 changed files with 37 additions and 13 deletions

View File

@ -1,5 +1,5 @@
import json
import os, time, uuid, shutil
import os, time, uuid, shutil, sys
from traceback import print_exc
from qtsymbols import *
@ -743,7 +743,18 @@ def get_font_default(lang: str, issetting: bool) -> str:
l = lang if lang in static_data[t].keys() else "default"
font_default = ""
for font in static_data[t][l]:
if isinstance(static_data[t][l], list):
fontlist = static_data[t][l]
elif isinstance(static_data[t][l], dict):
if tuple(sys.version_info)[:2] == (3, 4):
target = "xp"
else:
target = "normal"
fontlist = static_data[t][l].get(target, [])
else:
fontlist = []
for font in fontlist:
if is_font_installed(font):
font_default = font
break

View File

@ -309,17 +309,30 @@
"Microsoft Sans Serif",
"Arial"
],
"zh": [
"Microsoft YaHei UI",
"微软雅黑",
"Microsoft YaHei",
"黑体",
"SimHei",
"新宋体",
"NSimSun",
"宋体",
"SimSun"
],
"zh": {
"xp": [
"Microsoft YaHei UI",
"微软雅黑",
"Microsoft YaHei",
"新宋体",
"NSimSun",
"宋体",
"SimSun",
"黑体",
"SimHei"
],
"normal": [
"Microsoft YaHei UI",
"微软雅黑",
"Microsoft YaHei",
"黑体",
"SimHei",
"新宋体",
"NSimSun",
"宋体",
"SimSun"
]
},
"ja": [
"Yu Gothic UI",
"游ゴシック",