Artem Kozmin Posted November 23, 2006 Share Posted November 23, 2006 I use imagettfbbox() function to get string width:$bounds = imagettfbbox(10, $font_angle, $font_file, "This space is forrent :)");$width = $bounds[4] - $bounds[0];$bounds = imagettfbbox(10, $font_angle, $font_file, "The Pyramid of Khufu");$width = $bounds[4] - $bounds[0];It returns 105 as width for two strings above.if we change font size to 14, width of string "This space is for rent:)" is 155, and width of string "The Pyramid of Khufu" is 146.Note these strings have same width in font size 10 and they havedifferent width in font size 14.Is it problem with TTF font resize?I use PHP 4.3.11 and GD bundled (2.0.28 compatible)Best regards, Artem Link to comment https://forums.phpfreaks.com/topic/28265-imagettfbbox-problem/ Share on other sites More sharing options...
Barand Posted November 23, 2006 Share Posted November 23, 2006 I suspect it's because any slight differences in individual character widths become more apparent with larger font sizes Link to comment https://forums.phpfreaks.com/topic/28265-imagettfbbox-problem/#findComment-129294 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.