xref: /PHP-7.1/ext/gd/tests/bug48732-mb.phpt (revision bf35b31f)
1--TEST--
2Bug #48732 (TTF Bounding box wrong for letters below baseline)
3--SKIPIF--
4<?php
5	if(!extension_loaded('gd')){ die('skip gd extension not available'); }
6	if(!function_exists('imagefttext')) die('skip imagefttext() not available');
7	if (substr(PHP_OS, 0, 3) == 'WIN') die('skip UTF-8 font file names not yet supported on Windows');
8?>
9--FILE--
10<?php
11$cwd = dirname(__FILE__);
12$font = "$cwd/Tuffy私はガラスを食べられます.ttf";
13$g = imagecreate(100, 50);
14$bgnd  = imagecolorallocate($g, 255, 255, 255);
15$black = imagecolorallocate($g, 0, 0, 0);
16$bbox  = imagettftext($g, 12, 0, 0, 20, $black, $font, "ABCEDFGHIJKLMN\nopqrstu\n");
17imagepng($g, "$cwd/bug48732私はガラスを食べられます.png");
18echo 'Left Bottom: (' . $bbox[0]  . ', ' . $bbox[1] . ')';
19?>
20--CLEAN--
21<?php @unlink(dirname(__FILE__) . '/bug48732私はガラスを食べられます.png'); ?>
22--EXPECTF--
23Left Bottom: (0, 46)
24