EOSERV Forum > EOSERV > PHP GD: Text Align Center
Topic is locked.
Page: << 1 >>
PHP GD: Text Align Center
Author Message
Post #3550 PHP GD: Text Align Center

-.- I've been at it for awile and just can't seem to get it.

Anyone know?
Possibly Sausage, I see it being used on your style 1,3, and 4 of you eosig that you made for endless online.
It would be awesome if you could supply me with the source =D.

Its kindof eoserv related, because it will be going on my eosig that is made for eoserv, =p

edit: 
I've Figured it out, for anyone interested here it is!

<?php
header('Content-Type: image/png');
$bg = imagecreatefrompng('resources/newback.png'); //Background Image
$insert = imagecreatefrompng("test.png"); //image used for centering text
$text="vaden";
$font="resources/arial.ttf";

$black =ImageColorAllocate ($insert, 0, 0, 0);

$bbox=imagettfbbox (11, 0, $font, $text);
$xcorr=0-$bbox[6];
$mase=$bbox[2]+$xcorr;

$width=imagesx($insert);
$new=($width-$mase)/2;

imagettftext ($bg, 11, 0, $new, 16, $black, $font, $text);

imagepng($bg); 
imagedestroy($bg);
?>
16 years, 5 weeks ago
Page: << 1 >>
Topic is locked.
EOSERV Forum > EOSERV > PHP GD: Text Align Center