tweaks to UI font on win/lin
This commit is contained in:
parent
53f7457d4c
commit
46dae2507b
@ -140,10 +140,20 @@ class AnkiWebView(QWebEngineView):
|
|||||||
return max(1, dpi / 96.0)
|
return max(1, dpi / 96.0)
|
||||||
|
|
||||||
def stdHtml(self, body, css="", bodyClass="", js=None, head=""):
|
def stdHtml(self, body, css="", bodyClass="", js=None, head=""):
|
||||||
|
if isWin:
|
||||||
|
fontspec = 'font-size:12px;font-family:"Segoe UI";font-weight: medium;'
|
||||||
|
elif isMac:
|
||||||
|
fontspec = ""
|
||||||
|
else:
|
||||||
|
family = self.font().family()
|
||||||
|
print("family", family)
|
||||||
|
fontspec = 'font-size:14px;font-family:%s;font-weight:medium;'%\
|
||||||
|
family
|
||||||
|
|
||||||
self.setHtml("""
|
self.setHtml("""
|
||||||
<!doctype html>
|
<!doctype html>
|
||||||
<html><head><title>%s</title><style>
|
<html><head><title>%s</title><style>
|
||||||
body { zoom: %f; }
|
body { zoom: %f; %s }
|
||||||
%s</style>
|
%s</style>
|
||||||
<script>
|
<script>
|
||||||
%s
|
%s
|
||||||
@ -153,7 +163,9 @@ body { zoom: %f; }
|
|||||||
</head>
|
</head>
|
||||||
<body class="%s">%s</body></html>""" % (
|
<body class="%s">%s</body></html>""" % (
|
||||||
self.title,
|
self.title,
|
||||||
self.zoomFactor(), css, js or anki.js.jquery+anki.js.browserSel,
|
self.zoomFactor(),
|
||||||
|
fontspec,
|
||||||
|
css, js or anki.js.jquery+anki.js.browserSel,
|
||||||
head, bodyClass, body))
|
head, bodyClass, body))
|
||||||
|
|
||||||
def setCanFocus(self, canFocus=False):
|
def setCanFocus(self, canFocus=False):
|
||||||
|
Loading…
Reference in New Issue
Block a user