I need to determinate text width in my html. I use php GD2 library and calculate text width but calculated width different from chrome developer toolbar width.
<?php
$text = 'HELLO WORLD';
$font = './fonts/Helvetica___.ttf';
$fontSize = "12";
$bbox = imagettfbbox($fontSize, 0, $font, $text);
$width = $bbox[4] - $bbox[0];
echo "point=".$width.'<br>';
echo "pixel=".ceil((($width * 96) / 72)).'<BR>';
echo '<p><span style="font-family: helvetica;font-size:12px;">'.$text.'</span></p>';
exit();