InkyHAT quirk under Buster

I’ve been tracking down a quirk in my Python 3 code for driving the InkyHAT where some of the characters where not being displayed…

Having pulled a good chunk of my remaining hair out, I’ve finally tracked it down to PILLOW under BUSTER (total fluke I saw it in the beginning I think). As I could not find a solid error in my code, I created a simple test program:

from PIL import Image, ImageDraw, ImageFont

image_obj = Image.new('P', (212, 104), color = (255,255,255))
screen_image = ImageDraw.Draw(image_obj)

osbi = ImageFont.truetype('Fonts/OpenSans-BoldItalic.ttf', 15)
screen_image.text((10,10), 'Network Status test',fill = (0,0,0) , font = osbi)
screen_image.text((10,30), 'Bit longer no iffy ending',fill = (0,0,0) , font = osbi)

ubuntu = ImageFont.truetype('Fonts/Ubuntu-BI.ttf', 15)
screen_image.text((10,60), 'Network Status test',fill = (0,0,0) , font = ubuntu)
screen_image.text((10,80), 'Bit longer no iffy ending',fill = (0,0,0) , font = ubuntu)

image_obj.save('italic-test.png')

and this created:

italic-test
If you look at the third line you see the final character is not complete.

So far I have found it is only with italic true type fonts where the text is a certain length and I cannot find any work around other than padding the end with spaces. Time to find out how to report a bug on Github me thinks…

If you want to test it, you can download the fonts from Font Squirrel and play around. Its somewhere in the 105-110 pixel region where it glitches.