imagettfbbox problem
Posted: Thu Nov 23, 2006 2:48 pm
feyd | Please use
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 have
different 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
feyd | Please use
Code: Select all
,Code: Select all
and [syntax="..."] tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read: [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color]
I use imagettfbbox() function to get string width:Code: Select all
$bounds = imagettfbbox(10, $font_angle, $font_file, "This space is for
rent ");
$width = $bounds[4] - $bounds[0];
$bounds = imagettfbbox(10, $font_angle, $font_file, "The Pyramid of Khufu");
$width = $bounds[4] - $bounds[0];if we change font size to 14, width of string "This space is for rent
Note these strings have same width in font size 10 and they have
different 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
feyd | Please use
Code: Select all
,Code: Select all
and [syntax="..."] tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read: [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color]