From 0543df7dfaaf67b41d6ac8fa4db72220856014b0 Mon Sep 17 00:00:00 2001 From: Damien Elmes Date: Wed, 6 Mar 2019 15:28:49 +1000 Subject: [PATCH] allow translators to override Windows font to work around Qt's awful fallback handling on Windows 10 https://anki.tenderapp.com/discussions/ankidesktop/32922-chinese-characters-in-the-main-window-when-setting-language-to-japanese --- aqt/webview.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/aqt/webview.py b/aqt/webview.py index ee99fb5bb..4bc5497e6 100644 --- a/aqt/webview.py +++ b/aqt/webview.py @@ -229,8 +229,10 @@ class AnkiWebView(QWebEngineView): if js is None: js = ["jquery.js"] if isWin: - widgetspec = "button { font-size: 12px; font-family:'Segoe UI'; }" - fontspec = 'font-size:12px;font-family:"Segoe UI";' + #T: include a font for your language on Windows, eg: "Segoe UI", "MS Mincho" + family = _('"Segoe UI"') + widgetspec = "button { font-size: 12px; font-family:%s; }" % family + fontspec = 'font-size:12px;font-family:%s;' % family elif isMac: family="Helvetica" fontspec = 'font-size:15px;font-family:"%s";'% \