关键代码如下:
$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
$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
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;
}
谢谢!请问在 pdflib lite下有其他办法自己添加字体吗?比如说越南语,thai……
貌似只有UTF-8支持越南语