mirror of
https://github.com/HIllya51/LunaTranslator.git
synced 2024-12-28 08:04:13 +08:00
font
This commit is contained in:
parent
ddaa953765
commit
735703aa4c
@ -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
|
||||
|
@ -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",
|
||||
"游ゴシック",
|
||||
|
Loading…
x
Reference in New Issue
Block a user