Fredrik Lundh fredrik at pythonware.com
Tue Nov 23 14:58:01 CET 2004

"israel diaz" wrote:

> for x in range(0,10):
>     draw.text((20,x*51.2),"hola mundo",font=fm, fill="white")

> But I have a question how I can aligned to the other side in the right of the image

align what?  the text?  just use textsize, and subtract the width from the
X coordinate:

    for x in range(0,10):
        s = "hola mundo"
        w, h = draw.textsize(s, font=fm)
        draw.text((20+X-w,x*51.2), s, font=fm, fill="white")


More information about the Python-list mailing list