diff options
| author | Lorry Tar Creator <lorry-tar-importer@baserock.org> | 2013-03-14 05:42:27 +0000 |
|---|---|---|
| committer | <> | 2013-04-03 16:25:08 +0000 |
| commit | c4dd7a1a684490673e25aaf4fabec5df138854c4 (patch) | |
| tree | 4d57c44caae4480efff02b90b9be86f44bf25409 /ext/gd/tests/bug49600.phpt | |
| download | php2-master.tar.gz | |
Imported from /home/lorry/working-area/delta_php2/php-5.4.13.tar.bz2.HEADphp-5.4.13master
Diffstat (limited to 'ext/gd/tests/bug49600.phpt')
| -rw-r--r-- | ext/gd/tests/bug49600.phpt | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/ext/gd/tests/bug49600.phpt b/ext/gd/tests/bug49600.phpt new file mode 100644 index 0000000..068f8f3 --- /dev/null +++ b/ext/gd/tests/bug49600.phpt @@ -0,0 +1,32 @@ +--TEST-- +Bug #49600 (imageTTFText text shifted right) +--SKIPIF-- +<?php + if(!extension_loaded('gd')){ die('skip gd extension not available'); } + if(!function_exists('imagettftext')) die('skip imagettftext() not available'); + if(!function_exists('imagettfbbox')) die('skip imagettfbbox() not available'); +?> +--FILE-- +<?php +$cwd = dirname(__FILE__); +$font = "$cwd/Tuffy.ttf"; +$image = imagecreatetruecolor(50, 50); +$color = imagecolorallocate($image, 255, 255, 255); +foreach (array("E", "I", "P", "g", "i", "q") as $c) +{ + $x = imagettftext($image, 32, 0, 0, 0, $color, $font, $c); + $y = imagettfbbox(32, 0, "$cwd/Tuffy.ttf", $c); + if ( abs($x[0] - $y[0]) > 1 + || abs($x[2] - $y[2]) > 1 + || abs($x[4] - $y[4]) > 1 + || abs($x[6] - $y[6]) > 1 ) { + echo "FAILED: \n"; + var_dump($x); + var_dump($y); + exit; + } +} +echo 'OK'; +?> +--EXPECTF-- +OK
\ No newline at end of file |
