代码如下// Now the meat, we have to build the signature depending on the random holders
$sigwidth = 1; $maxheight=1;
while (list($numl, $line) = each($lines)) {
    list($pos_blx, $pos_bly, $pos_brx, $pos_bry, $pos_trx, $pos_try, $pos_tlx, $pos_tly) = imagettfbbox($fontsize, $textangle, $fontfile, $line);
    $textwidth = $pos_brx - $pos_blx;
    $textheight = $pos_bly - $pos_tly;    if ( $textwidth > $sigwidth ) $sigwidth = $textwidth;
    if ( $textheight > $maxheight ) $maxheight = $textheight;
}
reset($lines);

解决方案 »

  1.   

    看代码的提示,这里似乎是生成一个随机数字,但是生成图片,用来防止暴力注册的很可能的原因是你的php没有配置上gd的FreeType支持和 gettext支持
      

  2.   

    检查变量$fontfile的值,他应该是正确的ttf字库文件名
      

  3.   

    很可能的原因是你的php没有配置上gd的FreeType支持和 gettext支持
    请问怎么配置?
      

  4.   

    sorry, 现在我肯定可能还是ttf字库没有找到的可能性更答,因为没有gd库的话应该提示没有找到gd库的相关信息查看有没有装gd等配置,可以用<?php
    phpinfo();
    ?>来看你的php配置,看看里面有没有gd和truetype等配置上
    你可能因为没有 ttf字库的原因你可以在while循环前
    echo $fontfile;然后看看你是否有这个font字库文件
      

  5.   

    我把$fontfile的值打出来了,然后在浏览器里打出可以下载下来。
    这说明$fontfile的路径是对的,可是为什么程序提示找不到或打不开呢?