From 9448bf3537e7d2eb0bd196fe81d68227e33cdcdf Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Mon, 16 Sep 2019 11:13:45 +0530 Subject: [PATCH] Since we can set the user agent font size in the standalone viewer, use that instead of overriding the font size of --- src/calibre/gui2/viewer/web_view.py | 4 ++-- src/pyj/read_book/settings.pyj | 4 +++- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/src/calibre/gui2/viewer/web_view.py b/src/calibre/gui2/viewer/web_view.py index 7a93a047b9..55daabd6e0 100644 --- a/src/calibre/gui2/viewer/web_view.py +++ b/src/calibre/gui2/viewer/web_view.py @@ -463,9 +463,9 @@ class WebView(RestartingWebEngineView): elif key != '*': sd = vprefs['session_data'] sd[key] = val - if key == 'standalone_font_settings': - apply_font_settings(self._page) vprefs['session_data'] = sd + if key in ('standalone_font_settings', 'base_font_size'): + apply_font_settings(self._page) def do_callback(self, func_name, callback): cid = next(self.callback_id_counter) diff --git a/src/pyj/read_book/settings.pyj b/src/pyj/read_book/settings.pyj index 5b4f064d1b..d8adc85187 100644 --- a/src/pyj/read_book/settings.pyj +++ b/src/pyj/read_book/settings.pyj @@ -3,6 +3,7 @@ from __python__ import hash_literals from elementmaker import E +from read_book.globals import runtime opts = {} @@ -19,7 +20,8 @@ update_settings() def apply_font_size(): - document.documentElement.style.fontSize = '{}px'.format(opts.base_font_size) + if not runtime.is_standalone_viewer: + document.documentElement.style.fontSize = '{}px'.format(opts.base_font_size) def apply_colors():