Dont die while rationalizing font sizes on LRF files with no text content.

This commit is contained in:
Kovid Goyal 2008-01-03 20:48:41 +00:00
parent 6853bfbd88
commit 7ea58726b4

View File

@ -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