Hi,
I used imagettfbbox function for calculating text width and my code was:-
$bbox = imagettfbbox($font_size, 0, $font_file, $text_string);
$width_text = abs($bbox[4] - $bbox[6]); # width of the text
$height_text = abs($bbox[7] - $bbox[1]); # height of the text
I am getting height value correct, but wrong width value, the width value being returned is more than what is actual value, the error gap increases with font size and/or text length. I am calculating the actual value by creating the same text string of same font family and size in Adobe Photoshop and from there, getting its height and width values.
Please tell me why is this happening and also the solution.
Thanks