The _calc_maxchar method in Block.TextBlock needs to be updated to use either getbox or getlength. One of these two methods should be more precise than the current bodge.
WARNING:root:no font size set, using {font_size}
/tmp/ipykernel_5447/3591940074.py:220: DeprecationWarning: getsize is deprecated and will be removed in Pillow 10 (2023-07-01). Use getbbox or getlength instead.
s_length = self.font.getsize(s)[0] # string length in Pixles
The
_calc_maxchar
method inBlock.TextBlock
needs to be updated to use eithergetbox
orgetlength
. One of these two methods should be more precise than the current bodge.