txoof / epdlib

Python library for creating and writing modular layouts for e-paper screens
GNU General Public License v3.0
16 stars 8 forks source link

italic fonts sometimes cut off at left edge of TextBlocks #14

Open txoof opened 3 years ago

txoof commented 3 years ago

Lower case descenders on some italic fonts stretch outside of the measured bounding box as calculated by Pillow. Adjusting the anchors for measurement bounds of multiline_textbox. This causes the left hand pixels to be cut off in some instances. the letters p, g, j appear to be most affected.

TextBlock currently uses the anchor ld, which should cover this, but for some reason some italic fonts are miss calcuated. https://pillow.readthedocs.io/en/stable/handbook/text-anchors.html#text-anchors

txoof commented 1 year ago

the getbbox method can help resolve this