mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Conversion pipeline: Do not error out on books that set font size to zero. Fixes #898194 (Private bug)
This commit is contained in:
parent
5943156eaa
commit
b2bea092fc
@ -539,7 +539,8 @@ class Style(object):
|
|||||||
'Return value in pts'
|
'Return value in pts'
|
||||||
if base is None:
|
if base is None:
|
||||||
base = self.width
|
base = self.width
|
||||||
font = font or self.fontSize
|
if not font and font != 0:
|
||||||
|
font = self.fontSize
|
||||||
return unit_convert(value, base, font, self._profile.dpi)
|
return unit_convert(value, base, font, self._profile.dpi)
|
||||||
|
|
||||||
def pt_to_px(self, value):
|
def pt_to_px(self, value):
|
||||||
|
@ -283,7 +283,10 @@ class CSSFlattener(object):
|
|||||||
psize = fsize
|
psize = fsize
|
||||||
elif 'font-size' in cssdict or tag == 'body':
|
elif 'font-size' in cssdict or tag == 'body':
|
||||||
fsize = self.fmap[font_size]
|
fsize = self.fmap[font_size]
|
||||||
cssdict['font-size'] = "%0.5fem" % (fsize / psize)
|
try:
|
||||||
|
cssdict['font-size'] = "%0.5fem" % (fsize / psize)
|
||||||
|
except ZeroDivisionError:
|
||||||
|
cssdict['font-size'] = '%.1fpt'%fsize
|
||||||
psize = fsize
|
psize = fsize
|
||||||
|
|
||||||
try:
|
try:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user