Hi,

for example i have this html code:

<p><strong>Text text.</strong></p>
<p><span style="font-size: 14pt;"><span style="background-color: #ff0000;">Text text...</span></span></p>

Possible write this text with this style on the image (with php GD)?

Thanks

You may change the postion of the text in the image.
Please see as below.

<?php
        header("Content-type: image/png");
$im = imagecreatetruecolor(400, 30);
$white = imagecolorallocate($im, 255, 255, 255);
$grey = imagecolorallocate($im, 128, 128, 128);
$black = imagecolorallocate($im, 0, 0, 0);
imagefilledrectangle($im, 0, 0, 399, 29, $white);
$text = 'OK It Works...';
$font = '../arial.ttf';
//imagettftext($im, 20, 0, 11, 21, $grey, $font, $text);
imagettftext($im, 20, 0, 10, 20,$grey,$font, $text);
imagepng($im);
imagedestroy($im);
?>
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.