mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Conversion pipeline: Ignore the useless font-face rules inserted by Microsoft Word for every font on the system
This commit is contained in:
parent
4224b8bf3b
commit
c4af53417e
@ -347,7 +347,11 @@ class Stylizer(object):
|
|||||||
style = self.flatten_style(rule.style)
|
style = self.flatten_style(rule.style)
|
||||||
self.page_rule.update(style)
|
self.page_rule.update(style)
|
||||||
elif isinstance(rule, CSSFontFaceRule):
|
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
|
return results
|
||||||
|
|
||||||
def flatten_style(self, cssstyle):
|
def flatten_style(self, cssstyle):
|
||||||
|
Loading…
x
Reference in New Issue
Block a user