Forum Moderators: coopster

Message Too Old, No Replies

gd library text formatting code

         

D_Murphy

7:01 pm on Nov 27, 2006 (gmt 0)

10+ Year Member



Hello,

I am wondering if there is a way using the gd library to make generated images with text be bold or underlined or italic or any other formating options.

Is it at all possible?

If so can ya help a guy out with the code :)

Thank you
D. Murphy

D_Murphy

9:26 pm on Nov 27, 2006 (gmt 0)

10+ Year Member



here is my result code

Basicaly i want a way to make it so if a check box is ticked then it will make the text output bold

return $result;
}
//echo $color;
//echo substr($color,0,2);
$r = hextodes(substr($color,0,2));
$g = hextodes(substr($color,2,2));
$b = hextodes(substr($color,4,2));
//$user_width = imagettfbbox(9, 0,$font['font_url'], $text);
//$x_value = (200 - ($user_width[2] + 101));
//echo $b;
$color = imagecolorallocate($im,$r,$g,$b);
imagettftext($im, $height, $angle , $x, $y, $color, $font['font_url'], $text);
imagepng($im);
header('Content-type: ' . image_type_to_mime_type(IMAGETYPE_WBMP));
image2wbmp($im);
imagedestroy($im);
?>

eelixduppy

10:58 pm on Nov 27, 2006 (gmt 0)



I think you are going to have to use another font--a bolder one--to achieve this. You can also change the color of the text.

>>or italic

Check out imagepsslantfont [us3.php.net].

Anyway, I wish you luck. You may be able to find something at [phpclasses.org...] that does what you want.

henry0

9:34 pm on Nov 28, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



I just was digging in GD

the following should get you on the road
From PHP Manual [us3.php.net]