kokos — 2006-05-06T06:57:15-04:00 — #1
How can I change the alignment of text I output to right or center?
kokos — 2006-05-06T17:56:42-04:00 — #2
f4nat1c — 2006-05-06T19:38:57-04:00 — #3
It's based on co-ordinates. You can't specifically ask it to align left centre or right because it's an image, but you can align it using co-ordnates.
div_by_zero — 2006-05-06T20:37:57-04:00 — #4
You actually can't really choose a font alignment with imagettftext, what you can do is determine the size of the text that will be produced with imageftbbox and then align the x & y where you are going to place the text in the image.
I've worked alot with it for www.writeonit.org where we let the user write on some images and the alignment part was a real pain Anyhow, if you have to align multilines text I'd suggest to split the text and do an imagettftext for each line.