mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Dont die while rationalizing font sizes on LRF files with no text content.
This commit is contained in:
parent
6853bfbd88
commit
7ea58726b4
@ -581,6 +581,10 @@ class Book(Delegator):
|
|||||||
else:
|
else:
|
||||||
fonts[fs] = 1
|
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])
|
old_base_font_size = float(max(zip(fonts.keys(), fonts.values()), key=operator.itemgetter(1))[0])
|
||||||
|
|
||||||
factor = base_font_size/old_base_font_size
|
factor = base_font_size/old_base_font_size
|
||||||
|
Loading…
x
Reference in New Issue
Block a user