mirror of
https://github.com/gryf/ebook-converter.git
synced 2026-03-19 00:13:52 +01:00
Remove getsize method of PIL in favor of getbbox
This commit is contained in:
@@ -145,7 +145,7 @@ class Cell(object):
|
||||
continue
|
||||
word = token.split()
|
||||
word = word[0] if word else ""
|
||||
width = font.getsize(word)[0]
|
||||
width = font.getbbox(word)[2]
|
||||
if width > mwidth:
|
||||
mwidth = width
|
||||
return parindent + mwidth + 2
|
||||
@@ -191,7 +191,7 @@ class Cell(object):
|
||||
if (ff, fs) != (ts['fontfacename'], ts['fontsize']):
|
||||
font = get_font(ff, self.pts_to_pixels(fs))
|
||||
for word in token.split():
|
||||
width, height = font.getsize(word)
|
||||
_, _, width, height = font.getbbox(word)
|
||||
left, right, top, bottom = add_word(width, height, left, right, top, bottom, ls, ws)
|
||||
return right+3+max(parindent, 10), bottom
|
||||
|
||||
|
||||
Reference in New Issue
Block a user