【问题标题】:How to Add own Font (Japanese font) in FPDI Library?如何在 FPDI 库中添加自己的字体(日文字体)?
【发布时间】:2020-05-22 06:37:44
【问题描述】:

这是一个例子。如何添加我下载的字体。流程如何?

$pdf = new FPDI();
$pdf->AddPage();
$pdf->setSourceFile('sample source of the template.pdf');
$tplIdx = $pdf->importPage(1);
$pdf->useTemplate($tplIdx, 0, 0, 210);
$pdf->AddFont('japanesefontnameSample', '', 'japaneseFontsample.ttf', true);
$pdf->SetFont('japanesefontnameSample');
$pdf->SetFontSize(12);
$pdf->SetXY(20, 23);
$pdf->SetTextColor(0, 0, 0);

【问题讨论】:

  • 看看this的答案。
  • 成功加载字体但仍无法识别日文字体。它变成了像这样的特殊字符“ã,µãƒ‹ãƒ¼ãƒ©ã,¤ãƒ•é•'葉”。你知道我可以用于日文字符的任何 tff 字体吗?

标签: php laravel fonts cjk fpdi


【解决方案1】:

您确定您使用的是 unicode 字体吗?不妨试试these 看看是否还有奇怪的符号。

【讨论】:

    猜你喜欢
    • 2021-09-08
    • 1970-01-01
    • 1970-01-01
    • 2012-03-20
    • 2015-07-05
    • 1970-01-01
    • 1970-01-01
    • 2018-02-11
    • 1970-01-01
    相关资源
    最近更新 更多