MOBI Output: Map a larger set of font names to sans-serif/monospace font in the MOBI file

This commit is contained in:
Kovid Goyal 2011-09-23 10:13:57 -06:00
parent 29414b0593
commit 52f1d7400d

View File

@ -367,9 +367,11 @@ class MobiMLizer(object):
istate.fgcolor = style['color'] istate.fgcolor = style['color']
istate.strikethrough = style['text-decoration'] == 'line-through' istate.strikethrough = style['text-decoration'] == 'line-through'
istate.underline = style['text-decoration'] == 'underline' istate.underline = style['text-decoration'] == 'underline'
if 'monospace' in style['font-family']: ff = style['font-family'].lower() if style['font-family'] else ''
if 'monospace' in ff or 'courier' in ff:
istate.family = 'monospace' istate.family = 'monospace'
elif 'sans-serif' in style['font-family']: elif ('sans-serif' in ff or 'sansserif' in ff or 'verdana' in ff or
'arial' in ff or 'helvetica' in ff):
istate.family = 'sans-serif' istate.family = 'sans-serif'
else: else:
istate.family = 'serif' istate.family = 'serif'