EPUB output:Fix glitch in HTML 3.2 font/@face -> CSS font-family conversion

This commit is contained in:
Kovid Goyal 2009-01-10 09:09:45 -08:00
commit 62344a216a

View File

@ -796,7 +796,18 @@ class Processor(Parser):
setting = '' setting = ''
face = font.attrib.pop('face', None) face = font.attrib.pop('face', None)
if face is not 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) color = font.attrib.pop('color', None)
if color is not None: if color is not None:
setting += 'color:%s'%color setting += 'color:%s'%color