mirror of
https://github.com/HIllya51/LunaTranslator.git
synced 2024-12-29 16:44:13 +08:00
font
This commit is contained in:
parent
ddaa953765
commit
735703aa4c
@ -1,5 +1,5 @@
|
|||||||
import json
|
import json
|
||||||
import os, time, uuid, shutil
|
import os, time, uuid, shutil, sys
|
||||||
from traceback import print_exc
|
from traceback import print_exc
|
||||||
from qtsymbols import *
|
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"
|
l = lang if lang in static_data[t].keys() else "default"
|
||||||
|
|
||||||
font_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):
|
if is_font_installed(font):
|
||||||
font_default = font
|
font_default = font
|
||||||
break
|
break
|
||||||
|
@ -309,17 +309,30 @@
|
|||||||
"Microsoft Sans Serif",
|
"Microsoft Sans Serif",
|
||||||
"Arial"
|
"Arial"
|
||||||
],
|
],
|
||||||
"zh": [
|
"zh": {
|
||||||
"Microsoft YaHei UI",
|
"xp": [
|
||||||
"微软雅黑",
|
"Microsoft YaHei UI",
|
||||||
"Microsoft YaHei",
|
"微软雅黑",
|
||||||
"黑体",
|
"Microsoft YaHei",
|
||||||
"SimHei",
|
"新宋体",
|
||||||
"新宋体",
|
"NSimSun",
|
||||||
"NSimSun",
|
"宋体",
|
||||||
"宋体",
|
"SimSun",
|
||||||
"SimSun"
|
"黑体",
|
||||||
],
|
"SimHei"
|
||||||
|
],
|
||||||
|
"normal": [
|
||||||
|
"Microsoft YaHei UI",
|
||||||
|
"微软雅黑",
|
||||||
|
"Microsoft YaHei",
|
||||||
|
"黑体",
|
||||||
|
"SimHei",
|
||||||
|
"新宋体",
|
||||||
|
"NSimSun",
|
||||||
|
"宋体",
|
||||||
|
"SimSun"
|
||||||
|
]
|
||||||
|
},
|
||||||
"ja": [
|
"ja": [
|
||||||
"Yu Gothic UI",
|
"Yu Gothic UI",
|
||||||
"游ゴシック",
|
"游ゴシック",
|
||||||
|
Loading…
x
Reference in New Issue
Block a user