From c4af53417eee433dc251626530e889da55cb28db Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Thu, 10 May 2012 18:39:44 +0530 Subject: [PATCH] Conversion pipeline: Ignore the useless font-face rules inserted by Microsoft Word for every font on the system --- src/calibre/ebooks/oeb/stylizer.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/calibre/ebooks/oeb/stylizer.py b/src/calibre/ebooks/oeb/stylizer.py index a85df4d744..be96a8dd03 100644 --- a/src/calibre/ebooks/oeb/stylizer.py +++ b/src/calibre/ebooks/oeb/stylizer.py @@ -347,7 +347,11 @@ class Stylizer(object): style = self.flatten_style(rule.style) self.page_rule.update(style) elif isinstance(rule, CSSFontFaceRule): - self.font_face_rules.append(rule) + if rule.style.length > 1: + # Ignore the meaningless font face rules generated by the + # benighted MS Word that contain only a font-family declaration + # and nothing else + self.font_face_rules.append(rule) return results def flatten_style(self, cssstyle):