ID:               27410
 Updated by:       [EMAIL PROTECTED]
 Reported By:      Gregory_mucha at hotmail dot com
-Status:           Open
+Status:           Bogus
 Bug Type:         GD related
 Operating System: Win98SE
 PHP Version:      4.3.4
 New Comment:

imagettfbbox_t() does not exist in PHP. 




Previous Comments:
------------------------------------------------------------------------

[2004-02-26 21:00:41] Gregory_mucha at hotmail dot com

Description:
------------
Application requires use of multiple truetype fonts to create a dynamic
display of characters, varying font sizes and colors.



As the same font is varied by size, the starting position of the font
appears to vary at zero degrees display.  This can be corrected with
math when a single font is utilized, but the problem quickly gets out
of hand when multiple fonts are used in the application.  The symptoms
of cut-off appear the same for a given font, but across fonts the
symptoms do vary.  Generally, two of the four sides of the bounding box
appear to be too small and the (x,y) start position incorrect.



I have gone to Boutell and asked for help, but he claims that
ImageTTFBBox and ImageTTFText are not his routines and the problem is
not, therefore, GD-related.



HAAAAAAALPPPP!!!

Reproduce code:
---------------
Header("Content-type: image/png");

$xshift = 0;   // AACHENB @ 50

$yshift = 0;   //

$xpad   = 0;   //

$ypad   = 0;   // 

$benchmark = "Mgy_|jW";

$box1 = imagettfbbox_t($s, 0, $font, "o");

$box2 = imagettfbbox_t($s, 0, $font, "gyjp");

$baseline = ($box2[1] - $box2[7]) - ($box1[1] - $box1[7]);

$box = imagettfbbox_t($s, 0, $font, $text . $benchmark);

$height = ($box[1] - $box[7]) + $ypad;

$box = imagettfbbox_t($s, 0, $font, $text);

$width  = ($box[2] - $box[0]) + $xpad;

$im = imagecreate($width, $height);

$bgc = hex2dec($bg_color);

$bg = ImageColorAllocate($im, $bgc['r'], $bgc['g'], $bgc['b']);

$mac = hex2dec($text_color);

$main = ImageColorAllocate($im, $mac['r'], $mac['g'], $mac['b']);

ImageTTFText($im, $s, 0, $xshift, ($height - $baseline) + $yshift,
$main, $font, $text);

ImagePng($im);

ImageDestroy($im);

Expected result:
----------------
http://www.geocities.com/paul475aw/Expected_Output.png

Actual result:
--------------
http://www.geocities.com/paul475aw/Actual_Output.png


------------------------------------------------------------------------


-- 
Edit this bug report at http://bugs.php.net/?id=27410&edit=1

Reply via email to