-
-
Notifications
You must be signed in to change notification settings - Fork 2.4k
Closed
Description
What did you do?
Created an image suitable for the Pimoroni InkyHat display
Added italic text onto the image object at different places
What did you expect to happen?
The whole of the last character of the text to be displayed as it did to render correctly on Stretch on the Pi Zero
Looking at the font from a Mac (Mojave), the characters look fine.
What actually happened?
Depending on the length of the text, some or all of the last character is missing when using some italic fonts. If the text length is around 105 - 110 pixels then you can lose some / all of the very last character.
Padding out the text string with spaces so it is longer than 110 pixels fixes the issue
What are your OS, Python and Pillow versions?
- OS: Raspbian Buster Lite (10.1) Kernel 4.19.75+ TIFF incorrect colours #1270 Tue Sep 24 18:38:54 BST 2019 armv6l GNU/Linux (running on a Pi Zero)
- Python: 3.7.3 - not tested under Python 2
- Pillow: 6.2.1 (installed using pip3)
The fonts used are available from Font Squirrel - the two are:
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')Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels
