source: src/router/php7/ext/gd/tests/bug48732-mb.phpt @ 31874

Last change on this file since 31874 was 31874, checked in by brainslayer, 3 months ago

update php

File size: 914 bytes
Line 
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)
Note: See TracBrowser for help on using the repository browser.