关键代码如下:
$path =  getcwd()."/src/fonts/newfont.TTF";
if(!PDF_set_parameter($p, "FontOutline", "myfont=$path"))
{
     PDEBUG("set parameter fontoutline fail", __FILE__, __LINE__);
}$fonthand = PDF_load_font($this->pdf, "myfont", "unicode", ""); //此行报错
if($fonthand == NULL)
{
     PDEBUG("failed to search for a font and prepare it for later use",__LINE__,__FILE__);
}if(!pdf_setfont($p, $fonthand, $big))
{
    pdebug("设置字体失败",__line__,__file__);
    return false;
}提示错误为:
Unicode and glyph id addressing not supported in PDFlib Lite'到网上找了N久没答案,请高手指教我用的pdflib 版本是 7.0.3

解决方案 »

  1.   

    $path =  getcwd()."/src/fonts/newfont.TTF";
    if(!PDF_set_parameter($p, "FontOutline", "myfont=$path"))
    {
         PDEBUG("set parameter fontoutline fail", __FILE__, __LINE__);
    }$fonthand = PDF_load_font($this->pdf, "myfont", "unicode", ""); //此行报错
    if($fonthand == NULL)
    {
         PDEBUG("failed to search for a font and prepare it for later use",__LINE__,__FILE__);
    }if(!pdf_setfont($p, $fonthand, $big))
    {
        pdebug("设置字体失败",__line__,__file__);
        return false;
    }
      

  2.   

    PDF_load_font 这个函数你定义了?网页头部有没有调用这个函数所在的网页?!!!
      

  3.   

    不好意思,我没有把所有代码写出来问题是 我把$fonthand = PDF_load_font($this->pdf, "myfont", "unicode", ""); 换成 $fonthand = PDF_load_font($this->pdf, "myfont", "ISO-8859-2", ""); 就能通过编译,并生产pdf文件
      

  4.   

    pdflib lite不支持 unicode
      

  5.   


    谢谢!请问在 pdflib lite下有其他办法自己添加字体吗?比如说越南语,thai…… 
      

  6.   

    用UTF-8试试
    貌似只有UTF-8支持越南语
      

  7.   

    还有就是你的字体必须支持UTF-8