imagettfbbox似乎不正确

时间:2018-04-29 09:48:01

标签: php gd

我有一个imagettfbbox的问题。它似乎输出错误的位置。

imagettftext($image, $size, 0, $x, $y, $color, $font_file, $arg);

$bbox = imagettfbbox($size, 0, "./soopafre.ttf", $arg);
imagesetpixel($image, $x+$bbox[0], $y+$bbox[1], $color);
imagesetpixel($image, $x+$bbox[2], $y+$bbox[3], $color);
imagesetpixel($image, $x+$bbox[4], $y+$bbox[5], $color);
imagesetpixel($image, $x+$bbox[6], $y+$bbox[7], $color);

这是输出:(红色透明方块添加了编辑软件)

enter image description here

为什么冒号位于bbox之外?

感谢您的帮助

1 个答案:

答案 0 :(得分:0)

正如Syscall所说,注意力不集中问题。在imagettfbbox和imagettftext中字体不正确。

相关问题