dpd66100 2012-09-20 13:18
浏览 11
已采纳

TCPDF + TinyMCE +新的<strong>字体

I would like to generate a PDF file with TCPDF. The content is generated with TinyMCE. I am using additional fonts I downloaded from fontsquirrel.com. So far so good.

When I select a font in TinyMCE then select the 'BOLD' option, the editor shows me the correct layout, but when the PDF is generated, the regular variant is used.

How can I solve this?

I added the fonts:

$pdf->addTTFfont(K_PATH_FONTS.'/Amaranth-Bold-webfont.ttf', 'TrueTypeUnicode', '', 32);
$pdf->addTTFfont(K_PATH_FONTS.'/Amaranth-webfont.ttf', 'TrueTypeUnicode', '', 32);
$pdf->addTTFfont(K_PATH_FONTS.'/Amaranth-Italic-webfont.ttf', 'TrueTypeUnicode', '', 32);
$pdf->addTTFfont(K_PATH_FONTS.'/Amaranth-BoldItalic-webfont.ttf', 'TrueTypeUnicode', '', 32);

And this is the HTML from TinyMCE:

<p>
  <strong>
    <span style="font-family: Amaranth-webfont; font-size: 36px;" data-mce-style="font-family: Amaranth-webfont; font-size: 36px;">Example text</span>
  </strong>
</p>

Thanks in advance!

  • 写回答

1条回答 默认 最新

  • dsgk40568 2012-09-22 21:59
    关注

    Take this with a pinch of salt because I have not worked with TCPDF for a couple of years.

    I seem to remember that the naming convention of the fonts is very important.

    Amaranth-Bold-webfont.ttf standard Amaranth-Bold-webfontb.ttf bold Amaranth-Bold-webfonti.ttf italic Amaranth-Bold-webfontib.ttf bold italic

    Hope that is useful.

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥15 微带串馈天线阵列每个阵元宽度计算
  • ¥15 关于无人驾驶的航向角
  • ¥15 keil的map文件中Image component sizes各项意思
  • ¥30 BC260Y用MQTT向阿里云发布主题消息一直错误
  • ¥20 求个正点原子stm32f407开发版的贪吃蛇游戏
  • ¥15 划分vlan后,链路不通了?
  • ¥20 求各位懂行的人,注册表能不能看到usb使用得具体信息,干了什么,传输了什么数据
  • ¥15 Vue3 大型图片数据拖动排序
  • ¥15 Centos / PETGEM
  • ¥15 划分vlan后不通了