Skip to content
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

multline text not supported #64

Open
Phoenix09 opened this issue Sep 17, 2019 · 1 comment
Open

multline text not supported #64

Phoenix09 opened this issue Sep 17, 2019 · 1 comment
Labels
enhancement help wanted Primary maintainers may not have time to resolve this

Comments

@Phoenix09
Copy link

#!/usr/bin/env python3

import aggdraw

from PIL import Image, ImageDraw, ImageFont

im = Image.new("RGBA", (256, 256), (255, 255, 255, 255))
draw = ImageDraw.Draw(im)
font = ImageFont.truetype("/usr/share/fonts/truetype/dejavu/DejaVuSans.ttf", 42)
draw.text((0, 0), "this\nis\nmultiline", font=font, fill=(0, 0, 0))
im.save("Pillow.png")


im = Image.new("RGBA", (256, 256), (255, 255, 255, 255))
draw = aggdraw.Draw(im)
font = aggdraw.Font("black", "/usr/share/fonts/truetype/dejavu/DejaVuSans.ttf", 42)
draw.text((0, 0), "this\nis\nmultiline", font)
draw.flush()
im.save("aggdraw.png")

Pillow:
Pillow

aggdraw:
aggdraw

@djhoese
Copy link
Member

djhoese commented Sep 17, 2019

To be clear, this isn't meant to work and is a missing feature in aggdraw. Looking at PIL's source code it looks like they have a completely separate method for multiline text (possibly added later): https://github.com/python-pillow/Pillow/blob/da39d4034213cae7e575d5e2252d7705080ab796/src/PIL/ImageDraw.py#L264-L409

Pull requests are welcome, but this functionality may be simpler if/when we move to cython as the core aggdraw language.

@djhoese djhoese added enhancement help wanted Primary maintainers may not have time to resolve this labels Sep 17, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement help wanted Primary maintainers may not have time to resolve this
Projects
None yet
Development

No branches or pull requests

2 participants