mirror of
git://github.com/kovidgoyal/calibre.git
synced 2026-05-03 01:33:11 +02:00
Also use the new font family parsing code in the conversion pipeline
This commit is contained in:
parent
86f114594c
commit
358ed508ce
1 changed files with 3 additions and 3 deletions
|
|
@ -11,6 +11,7 @@
|
|||
|
||||
from calibre.ebooks.oeb.base import urlnormalize
|
||||
from calibre.utils.fonts.sfnt.subset import subset, NoGlyphs, UnsupportedFont
|
||||
from tinycss.fonts3 import parse_font_family
|
||||
|
||||
def get_font_properties(rule, default=None):
|
||||
'''
|
||||
|
|
@ -27,7 +28,7 @@ def get_font_properties(rule, default=None):
|
|||
val = s.getProperty(q).propertyValue[0]
|
||||
val = getattr(val, g)
|
||||
if q == 'font-family':
|
||||
val = [x.value for x in s.getProperty(q).propertyValue if hasattr(x.value, 'lower')]
|
||||
val = parse_font_family(s.getProperty(q).propertyValue.cssText)
|
||||
if val and val[0] == 'inherit':
|
||||
val = None
|
||||
except (IndexError, KeyError, AttributeError, TypeError, ValueError):
|
||||
|
|
@ -272,8 +273,7 @@ def used_font(self, style):
|
|||
'normal':['normal', 'oblique', 'italic']
|
||||
}.get(fs, ['italic', 'oblique', 'normal'])
|
||||
for q in order:
|
||||
matches = [f for f in matching_set if f.get('font-style', 'normal')
|
||||
== q]
|
||||
matches = [f for f in matching_set if f.get('font-style', 'normal') == q]
|
||||
if matches:
|
||||
matching_set = matches
|
||||
break
|
||||
|
|
|
|||
Loading…
Reference in a new issue