-
-
Notifications
You must be signed in to change notification settings - Fork 2.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
draw text position incorrect #2486
Comments
ok i thought it might be something like that but could not find a definitive answer. Do you know of a way/point me in the right direction to calculate/discover what this offset will be? |
Here's one way: text = 'TEXT'
offset = font.getoffset(text)
draw.text((0-offset[0], 0-offset[1]), text, font=font)
img.save('/tmp/test3.png') |
oh ok note to self: RTFM |
Hello |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
What did you do?
Try and place text in the top corner of the image
What did you expect to happen?
Text is positioned at the top corner of the image
What actually happened?
The text is indent by a few positive pixels on x axis and around 10 positive pixels on the y axis.
What versions of Pillow and Python are you using?
Please include code that reproduces the issue and whenever possible, an image that demonstrates the issue. The best reproductions are self-contained scripts with minimal dependencies. If you are using a framework such as plone, django, or buildout, try to replicate the issue just using Pillow.
arial.ttf md5sum 096b6677fc4a0a2ab430cd3d28b6fd52
The text was updated successfully, but these errors were encountered: