Conversion: Handle embed font family and filter css conflict

Conversion: If both embed font family and the filter css option to
remove fonts are set, do not remove the font specified by the embed font
family option.
This commit is contained in:
Kovid Goyal 2013-10-17 09:07:15 +05:30
parent 42cc5b2813
commit 1c0849446b

View File

@ -410,7 +410,10 @@ class CSSFlattener(object):
if cssdict: if cssdict:
for x in self.filter_css: for x in self.filter_css:
cssdict.pop(x, None) popval = cssdict.pop(x, None)
if (self.body_font_family and popval and x == 'font-family' and
popval.partition(',')[0][1:-1] == self.body_font_family.partition(',')[0][1:-1]):
cssdict[x] = popval
if cssdict: if cssdict:
if self.lineh and self.fbase and tag != 'body': if self.lineh and self.fbase and tag != 'body':