From b9927abdae15d64d60fb9d057827da02d67120d3 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Fri, 3 Feb 2012 19:10:28 +0530 Subject: [PATCH] Ensure font family used in comment viewer/editor is the same as for the rest of the application --- src/calibre/gui2/book_details.py | 15 ++++++++++++--- src/calibre/gui2/comments_editor.py | 8 ++++++-- 2 files changed, 18 insertions(+), 5 deletions(-) diff --git a/src/calibre/gui2/book_details.py b/src/calibre/gui2/book_details.py index 6ad1aaf0c4..a9a0894345 100644 --- a/src/calibre/gui2/book_details.py +++ b/src/calibre/gui2/book_details.py @@ -38,14 +38,23 @@ def render_html(mi, css, vertical, widget, all_fields=False): # {{{ ans = unicode(col.name()) return ans - f = QFontInfo(QApplication.font(widget)).pixelSize() + fi = QFontInfo(QApplication.font(widget)) + f = fi.pixelSize()+1 + fam = unicode(fi.family()).strip() + if not fam: + fam = 'sans-serif' c = color_to_string(QApplication.palette().color(QPalette.Normal, QPalette.WindowText)) templ = u'''\