mirror of
git://github.com/kovidgoyal/calibre.git
synced 2026-05-05 05:13:42 +02: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
2 changed files with 6 additions and 2 deletions
|
|
@ -539,7 +539,8 @@ def _unit_convert(self, value, base=None, font=None):
|
|||
'Return value in pts'
|
||||
if base is None:
|
||||
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)
|
||||
|
||||
def pt_to_px(self, value):
|
||||
|
|
|
|||
|
|
@ -283,7 +283,10 @@ def force_int(raw):
|
|||
psize = fsize
|
||||
elif 'font-size' in cssdict or tag == 'body':
|
||||
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
|
||||
|
||||
try:
|
||||
|
|
|
|||
Loading…
Reference in a new issue