bla*_*d Ψ 43 pdf fonts pdf-generation tcpdf
在TCPDF中,只有少数字体可供选择,以创建pdf文件.我想设置Tahoma
为我的pdf字体.如何Tahoma
在TCPDF中包含?
Nic*_*uni 68
最新的TCPDF版本使用addTTFfont()方法自动将字体转换为TCPDF格式.例如:
// convert TTF font to TCPDF format and store it on the fonts folder
$fontname = TCPDF_FONTS::addTTFfont('/path-to-font/FreeSerifItalic.ttf', 'TrueTypeUnicode', '', 96);
// use the font
$pdf->SetFont($fontname, '', 14, '', false);
Run Code Online (Sandbox Code Playgroud)
有关更多信息和示例,请查看TCPDF字体文档页面.
注意:字体转换后,TCPDF不再需要TTF文件或上述调用addTTFfont()
!
小智 23
我在网上发现了一个非常好的工具.您唯一需要做的就是上传.ttf文件然后下载文件然后复制到/ fonts文件夹中.
http://www.xml-convert.com/en/convert-tff-font-to-afm-pfa-fpdf-tcpdf
addTTFfont方法在TCPDF主类上不可用,所以后面为我工作.
// convert TTF font to TCPDF format and store it on the fonts folder
$fontname = TCPDF_FONTS::addTTFfont('pathto/arial.ttf', 'TrueTypeUnicode', '', 96);
// use the font
$pdf->SetFont($fontname, '', 14, '', false);
Run Code Online (Sandbox Code Playgroud)
希望这可以帮助!
以下几行将在您的字体文件夹中生成 3 个文件 1.rotisserifi56.php 2.rotisserifi56.ctg 3.rotisserifi56.rar
use this to generate the required php and other files
$fontname = $this->pdf->addTTFfont('D:/wamp/www/projectname/sites/all/modules/civicrm/packages/tcpdf/fonts/Rotis Serif Italic 56.ttf', 'TrueTypeUnicode', '', 32);
// use the font
$this->pdf->SetFont($fontname, '', 14, '', false);
Run Code Online (Sandbox Code Playgroud)
现在,
使用这样的字体:
$this->pdf->AddFont('rotisserifi56', '', 'rotisserifi56.php');
$this->pdf->SetFont('rotisserifi56');
Run Code Online (Sandbox Code Playgroud)
--希望这对某人有所帮助:)
归档时间: |
|
查看次数: |
80566 次 |
最近记录: |