Applying text/string insertion to images using GD, including additional formatting like bold, italic, underline etc.
| From: | Jacob Kruger | Date: | Wed, 24 Jul 2013 20:39:16 +0000 |
| Subject: | Applying text/string insertion to images using GD, including additional formatting like bold, italic, underline etc. | ||
| Groups: | php.windows | ||
| Request: | Send a blank email to php-windows+get-31065@lists.php.net to get a copy of this message | ||
Like subject says, am just wondering what's the simplest/easiest way to implement something
like this?
It's easy enough to apply overlaid graphical text/string renditions to image resource
objects/files using something like imagettftext() function:
http://php.net/manual/en/function.imagettftext.php
And, only real issue there was figuring out that angle starts off at actual 90 degrees being applied
by using 00, and you are actually applying any additional angle values in sort of counter-clockwise
direction, so, for example, in order to have text angling downwards at roundabout 45 degrees from
horizontal - actually like 135 degrees from true 0 degrees, you need to apply an angle of 315
degrees to the imagettftext() function parameter/argument.
Anyway, aside from maybe getting hold of separate .ttf files for the other styles of same fonts, do
you have any thoughts regarding applying additional styling to text to be overlaid on image
resources?
TIA
Jacob Kruger
Blind Biker
Skype: BlindZA
'...fate had broken his body, but not his spirit...'