Fix glitch in HTML 3.2 font/@face -> CSS font-family conversion.

This commit is contained in:
Marshall T. Vandegrift 2009-01-10 00:34:02 -05:00
parent 7a5306e243
commit fb2832c3ed

View File

@ -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