From 7e50d7b6bf286da81eec552d531a5da9c07de743 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Wed, 24 Oct 2012 18:29:14 +0530 Subject: [PATCH] ... --- src/calibre/ebooks/oeb/iterator/extract_fonts.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/calibre/ebooks/oeb/iterator/extract_fonts.py b/src/calibre/ebooks/oeb/iterator/extract_fonts.py index 7b2ec5312f..dd2504b431 100644 --- a/src/calibre/ebooks/oeb/iterator/extract_fonts.py +++ b/src/calibre/ebooks/oeb/iterator/extract_fonts.py @@ -76,6 +76,14 @@ class FamilyMap(dict): family.encode('utf-8') def extract_fonts(opf, log): + ''' + Extract embedded fonts from the ebook and add them explicitly to the Qt + font database to workaround https://bugs.webkit.org/show_bug.cgi?id=29433 + + Only works if the font-face and font-family rules are all contained in the + CSS files (Also processing the HTML files would be too much of a + performance hit, to do robustly). + ''' css_files = {} font_family_map = FamilyMap(log) pat = re.compile(br'^\s*@font-face\s*{[^}]+}', re.M)