mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Fix glitch in HTML 3.2 font/@face -> CSS font-family conversion.
This commit is contained in:
parent
7a5306e243
commit
fb2832c3ed
@ -796,7 +796,18 @@ class Processor(Parser):
|
||||
setting = ''
|
||||
face = font.attrib.pop('face', None)
|
||||
if face is not None:
|
||||
setting += 'font-face:%s;'%face
|
||||
faces = []
|
||||
for face in face.split(','):
|
||||
if ' ' in face:
|
||||
face = "%s" % face
|
||||
faces.append(face)
|
||||
for generic in ('serif', 'sans-serif', 'monospace'):
|
||||
if generic in faces:
|
||||
break
|
||||
else:
|
||||
faces.append('serif')
|
||||
family = ', '.join(faces)
|
||||
setting += 'font-family: %s;' % family
|
||||
color = font.attrib.pop('color', None)
|
||||
if color is not None:
|
||||
setting += 'color:%s'%color
|
||||
|
Loading…
x
Reference in New Issue
Block a user