mirror of
git://github.com/kovidgoyal/calibre.git
synced 2026-05-09 01:03:26 +02:00
MOBI Output: Map a larger set of font names to sans-serif/monospace font in the MOBI file
This commit is contained in:
parent
29414b0593
commit
52f1d7400d
1 changed files with 4 additions and 2 deletions
|
|
@ -367,9 +367,11 @@ def mobimlize_elem(self, elem, stylizer, bstate, istates,
|
|||
istate.fgcolor = style['color']
|
||||
istate.strikethrough = style['text-decoration'] == 'line-through'
|
||||
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'
|
||||
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'
|
||||
else:
|
||||
istate.family = 'serif'
|
||||
|
|
|
|||
Loading…
Reference in a new issue