From 52f1d7400def2a2611ba72956675c88af652858f Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Fri, 23 Sep 2011 10:13:57 -0600 Subject: [PATCH] MOBI Output: Map a larger set of font names to sans-serif/monospace font in the MOBI file --- src/calibre/ebooks/mobi/mobiml.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/calibre/ebooks/mobi/mobiml.py b/src/calibre/ebooks/mobi/mobiml.py index 56a7a8b9ca..6c2af3795d 100644 --- a/src/calibre/ebooks/mobi/mobiml.py +++ b/src/calibre/ebooks/mobi/mobiml.py @@ -367,9 +367,11 @@ class MobiMLizer(object): 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'