From 8179235f2d968e14b892a6938cfd2a6746c9cb64 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Wed, 26 Dec 2018 13:33:52 +0530 Subject: [PATCH] Conversion: When converting with font size rescaling disabled, convert font size names to rem unit rather than pt units. Fixes #1809671 [AZW3 conversion generates font-sizes in points](https://bugs.launchpad.net/calibre/+bug/1809671) These give better results with kindle previewer when converting to AZW3 and are more re-scaleable in general. --- src/calibre/ebooks/oeb/stylizer.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/calibre/ebooks/oeb/stylizer.py b/src/calibre/ebooks/oeb/stylizer.py index b034124c8e..706a38240c 100644 --- a/src/calibre/ebooks/oeb/stylizer.py +++ b/src/calibre/ebooks/oeb/stylizer.py @@ -336,7 +336,7 @@ class Stylizer(object): if size == 'smallest': size = 'xx-small' if size in FONT_SIZE_NAMES: - style['font-size'] = "%dpt" % self.profile.fnames[size] + style['font-size'] = "%.1frem" % (self.profile.fnames[size] / float(self.profile.fbase)) if '-epub-writing-mode' in style: for x in ('-webkit-writing-mode', 'writing-mode'): style[x] = style.get(x, style['-epub-writing-mode'])