mirror of
git://github.com/kovidgoyal/calibre.git
synced 2026-03-03 09:04:52 +01:00
Dont die while rationalizing font sizes on LRF files with no text content.
This commit is contained in:
parent
6853bfbd88
commit
7ea58726b4
1 changed files with 4 additions and 0 deletions
|
|
@ -581,6 +581,10 @@ def rationalize_font_sizes(self, base_font_size=10):
|
|||
else:
|
||||
fonts[fs] = 1
|
||||
|
||||
if not fonts:
|
||||
print 'WARNING: LRF seems to have no textual content. Cannot rationalize font sizes.'
|
||||
return
|
||||
|
||||
old_base_font_size = float(max(zip(fonts.keys(), fonts.values()), key=operator.itemgetter(1))[0])
|
||||
|
||||
factor = base_font_size/old_base_font_size
|
||||
|
|
|
|||
Loading…
Reference in a new issue