The math on this checks out exactly the way it should, went through each step substituting in hard numbers and it still doesn't center the text. Any ideas?
<?php
header("Content-type: image/png");
$string = $_REQUEST['n'];
$image = imagecreatefrompng("images/lovesjuice.png");
$color = imagecolorallocate($image, 195, 31, 31);
$font = 'Tahoma.ttf';
$font_size = 50;
$font_width = imagefontwidth($font);
$half_width = imagesx($image)/2;
$x = round(($half_width-(strlen($string)*$font_width)), 1);
$y = 130;
imagettftext($image, $font_size, 0, $x, $y, $color, $font, $string);
imagepng($image);
imagedestroy($image);
?>