Pezmc Posted December 9, 2006 Share Posted December 9, 2006 I am using this script to generate changing text, how can I make the text always appear centered on the image?[code=php:0]<?php$text = $_GET["text"];$imgname = "images/bg.gif";header("Content-type: image/png");$im = imagecreatefromgif($imgname);$grey = imagecolorallocate($im, 128, 128, 128);$black = imagecolorallocate($im, 0, 0, 0);$font = 'fonts/neuropolx.ttf';//This text somehow needs to be centeredimagettftext($im, 10, 0, 15, 15, $grey, $font, $text);imagettftext($im, 10, 0, 14, 14, $black, $font, $text);imagepng($im);imagedestroy($im);?> [/code] Link to comment https://forums.phpfreaks.com/topic/30036-solved-gd-text/ Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.