【发布时间】:2019-01-16 11:47:00
【问题描述】:
为了在 DOMPdf 中添加新字体 Arvo,我更新了文件 dompdf_font_family_cache.dist 并添加以下代码 -
'arvo' =>
array (
'normal' => DOMPDF_FONT_DIR . 'Arvo-Regular',
'bold' => DOMPDF_FONT_DIR . 'Arvo-Bold',
'italic' => DOMPDF_FONT_DIR . 'Arvo-Italic',
'bold_italic' => DOMPDF_FONT_DIR . 'Arvo-BoldItalic',
),
我在 lib/fonts 目录中包含字体文件 我在 html 中添加了样式表 -
font-family: arvo;
但结果 pdf 中未添加新字体。 请帮我解决这个问题。
【问题讨论】:
-
您使用的是哪个版本的 dompdf?
-
您应该使用 load_font.php 或(在 dompdf 0.6.0 beta 3 中)位于 www/fonts.php 的基于 Web 的安装程序,而不是手动修改 dompdf_font_family_cache。
-
是的,你是对的,我使用了 load_font.php,现在字体正在输出 pdf 中工作。
-
如何使用 load_font.php ?表示将我的字体名称放在上述文件中的什么位置?
-
当我使用网络安装程序时,它会询问“dompdf_config.custom.inc.php”中的用户名和密码。