From a6097fab4a012c1010b384a8ab6b475534d96a26 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Mon, 9 Sep 2019 10:39:41 +0530 Subject: [PATCH] Fix default font family type not being respected in the viewer settings --- src/pyj/read_book/resources.pyj | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/pyj/read_book/resources.pyj b/src/pyj/read_book/resources.pyj index ef3e5b4c5e..efb35bf5d2 100644 --- a/src/pyj/read_book/resources.pyj +++ b/src/pyj/read_book/resources.pyj @@ -6,7 +6,7 @@ from elementmaker import E from encodings import base64decode, utf8_decode from dom import clear, remove_all_attributes -from read_book.globals import ui_operations +from read_book.globals import ui_operations, runtime JSON_XHTML_MIMETYPE = 'application/calibre+xhtml+json' @@ -234,7 +234,10 @@ def unserialize_html(serialized_data, proceed, postprocess_dom): clear(document.head, document.body) remove_all_attributes(document.head, document.body) # Default stylesheet - document.head.appendChild(E.style(type='text/css', 'html {{ font-family: {} }}'.format(window.default_font_family or "sans-serif"))) + if not runtime.is_standalone_viewer: + # for the standalone viewer the default font family is set + # in the viewer settings + document.head.appendChild(E.style(type='text/css', 'html {{ font-family: {} }}'.format(window.default_font_family or "sans-serif"))) resource_urls = {} load_required = set() proceeded = False