PHP:imagettftext到达空格时停止

时间:2011-06-25 10:49:16

标签: php glyph imagettftext

http://ttgdark.com/plugins/xboximg.php?gamertag=testing ...

http://ttgdark.com/plugins/xboximg.php?gamertag=another测试

如果您注意到,第二个链接不会写“test”。我刚刚决定开始学习今天的动态图像写作,我真的不知道从哪里开始弄清楚什么是错的。这是我的代码:

<?php

    header ("Content-type: image/png");

    $font = 'micross.ttf';
    $image = @imagecreatefrompng( 'test.png' );
    $white = @imagecolorallocate( $image, 255, 255, 255 );
    $grey = @imagecolorallocate( $image, 128, 128, 128 );
    $black = @imagecolorallocate( $image, 0, 0, 0 );

    $text = $_GET['gamertag'];
      //$text = urlencode( $text ); // Replaces spaces with plus signs
    @imagettftext( $image, 11, 0, 40, 50, $black, $font, $text );
    @imagepng( $image );
    @imagedestroy( $image );

?>

PHP Warning: imagettftext() [<a href='function.imagettftext'>function.imagettftext</a>]: Problem rendering glyph in /var/www/vhosts/ttgdark.com/httpdocs/plugins/xboximg.php on line 12

1 个答案:

答案 0 :(得分:2)

然后有一些关于imagettftext()不喜欢的空间。也许它不喜欢你的字体或编码?尝试不同的字体,看看会发生什么。