From 79f2a2845763e4c1db74c85ca59f2607830e1f55 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Sun, 22 Dec 2013 14:54:26 +0530 Subject: [PATCH] Edit book: Automatic correction of font family names not quoting family names with spaces in them if the original, incorrect family name did not have a space. Fixes #1263448 [Problem with css auto-correct in editor](https://bugs.launchpad.net/calibre/+bug/1263448) --- src/calibre/ebooks/oeb/polish/check/fonts.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/calibre/ebooks/oeb/polish/check/fonts.py b/src/calibre/ebooks/oeb/polish/check/fonts.py index fb8eafd225..825d6aa8a9 100644 --- a/src/calibre/ebooks/oeb/polish/check/fonts.py +++ b/src/calibre/ebooks/oeb/polish/check/fonts.py @@ -31,6 +31,11 @@ def fix_declaration(style, css_name, font_name): val = ff.item(i) if val.value and val.value.lower() == css_name.lower(): val.value = font_name + # If val.type == 'IDENT' cssutils will not serialize the font + # name properly (it will not enclose it in quotes). There we + # use the following hack (setting an internal property of the + # Value class) + val._type = 'STRING' changed = True return changed