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.
This commit is contained in:
Kovid Goyal 2018-12-26 13:33:52 +05:30
parent d52a471481
commit 8179235f2d
No known key found for this signature in database
GPG Key ID: 06BC317B515ACE7C

View File

@ -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'])