From 5c100b4189844c89e1cddfcb6afef62dc670008d Mon Sep 17 00:00:00 2001 From: Damien Elmes Date: Sat, 22 Jan 2022 16:43:58 +1000 Subject: [PATCH] fall back on a sans-serif font if the system Linux font is unavailable The GNOME theme may return "Cantarell", which may not be installed. --- qt/aqt/webview.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/qt/aqt/webview.py b/qt/aqt/webview.py index 575338fad..21bd22663 100644 --- a/qt/aqt/webview.py +++ b/qt/aqt/webview.py @@ -421,12 +421,12 @@ border-radius:5px; font-family: Helvetica }""" family = self.font().family() color_hl_txt = palette.color(QPalette.ColorRole.HighlightedText).name() color_btn = palette.color(QPalette.ColorRole.Button).name() - font = f'font-size:14px;font-family:"{family}";' + font = f'font-size:14px;font-family:"{family}", sans-serif;' button_style = """ /* Buttons */ button{{ background-color: {color_btn}; - font-family:"{family}"; }} + font-family:"{family}", sans-serif; }} button:focus{{ border-color: {color_hl} }} button:active, button:active:hover {{ background-color: {color_hl}; color: {color_hl_txt};}} /* Input field focus outline */