X-Git-Url: https://git.mdrn.pl/librarian.git/blobdiff_plain/af72c4ed58e541d491dafbfe4ecb163662f402b5..e2acc67a478455184e5e714e63a61e78ad37d787:/src/librarian/covers/utils/textbox.py diff --git a/src/librarian/covers/utils/textbox.py b/src/librarian/covers/utils/textbox.py index cc9c501..e82bee4 100644 --- a/src/librarian/covers/utils/textbox.py +++ b/src/librarian/covers/utils/textbox.py @@ -1,3 +1,6 @@ +# This file is part of Librarian, licensed under GNU Affero GPLv3 or later. +# Copyright © Fundacja Wolne Lektury. See NOTICE for more information. +# import PIL.Image import PIL.ImageDraw @@ -18,7 +21,8 @@ def split_words(text): def text_with_tracking(draw, tracking, pos, text, fill=None, font=None): x, y = pos for c in text: - width = font.getsize(c)[0] + # TODO: adjust for kerning? + width = font.getlength(c) draw.text((x, y), c, fill=fill, font=font) x += width + tracking