Conversion pipeline: Ignore the useless font-face rules inserted by Microsoft Word for every font on the system

This commit is contained in:
Kovid Goyal 2012-05-10 18:39:44 +05:30
parent 4224b8bf3b
commit c4af53417e

View File

@ -347,6 +347,10 @@ class Stylizer(object):
style = self.flatten_style(rule.style)
self.page_rule.update(style)
elif isinstance(rule, CSSFontFaceRule):
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