mirror of
git://github.com/kovidgoyal/calibre.git
synced 2026-03-03 03:37:13 +01:00
Fix #219
This commit is contained in:
parent
4815ecf0ae
commit
5cebd90e8e
3 changed files with 12 additions and 6 deletions
|
|
@ -985,7 +985,7 @@ def __unicode__(self):
|
|||
(self.id, self.fontfilename, self.fontfacename, self.file)
|
||||
return s
|
||||
|
||||
class ObjectInfo(LRFObject):
|
||||
class ObjectInfo(LRFStream):
|
||||
pass
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -128,7 +128,10 @@ def layout_text_block(self, block, x, y):
|
|||
else:
|
||||
y += line.height
|
||||
if not block.has_content:
|
||||
y += block.bs.footskip
|
||||
try:
|
||||
y += block.bs.footskip
|
||||
except AttributeError: # makelrf generates BlockStyles without footskip
|
||||
pass
|
||||
block_consumed = True
|
||||
break
|
||||
else:
|
||||
|
|
|
|||
|
|
@ -75,10 +75,13 @@ def __init__(self, font_map, dpi):
|
|||
|
||||
def font(self, text_style):
|
||||
device_font = text_style.fontfacename in FONT_MAP
|
||||
if device_font:
|
||||
face = self.font_map[text_style.fontfacename]
|
||||
else:
|
||||
face = self.face_map[text_style.fontfacename]
|
||||
try:
|
||||
if device_font:
|
||||
face = self.font_map[text_style.fontfacename]
|
||||
else:
|
||||
face = self.face_map[text_style.fontfacename]
|
||||
except KeyError: # Bad fontfacename field in LRF
|
||||
face = self.font_map['Dutch801 Rm BT Roman']
|
||||
|
||||
sz = text_style.fontsize
|
||||
wt = text_style.fontweight
|
||||
|
|
|
|||
Loading…
Reference in a new issue