如何使DOMPDF逐步支持Unicode字体? [英] How to make DOMPDF support unicode font step by step?
本文介绍了如何使DOMPDF逐步支持Unicode字体?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我使用了DOMPDF库,现在我对Unicode语言的内容有疑问。并且我发现了这一个 dompdf帮助
,但我没有不了解这一点。谁能告诉我这个细节?
谢谢
I used DOMPDF library and now I have problem with content with unicode language. and I found this one dompdf help but I don't understand about this. can anyone tell the detail of this? thanks
推荐答案
- 启用 mbstring扩展
- 在
.ttf中查找字体
格式并带有支持您给定语言的字符 - 为DOMPDF生成
.afm
文件:
- Enable the mbstring extension
- Find a font in
.ttf
format with characters that support your given language - Generate a
.afm
file for DOMPDF:
- 使用命令行
cd
进入包含load_font.php $ c的目录$ c>,然后运行
php load_font.php FontName /path/to/font.ttf
- 使用在线工具,填写表格并下载提供给您的zip文件。将文件从此zip复制到
dompdf / lib / fonts
。如果您之前已完成此操作,则将相关行添加到dompdf_font_family_cache
,否则只需将dompdf_font_family_cache.sample
重命名为dompdf_font_family_cache
- Using the command line,
cd
into the directory which containsload_font.php
, then runphp load_font.php FontName /path/to/font.ttf
- Using the online tool, fill out the form and download the zip it gives you. Copy the files from this zip into
dompdf/lib/fonts
. If you've done this before, add relevant lines todompdf_font_family_cache
, otherwise simply rename thedompdf_font_family_cache.sample
todompdf_font_family_cache
通过确保该行启用DOMPDF的Unicode模式
Enable DOMPDF's Unicode mode, by making sure the line
define("DOMPDF_UNICODE_ENABLED", true);
设置在 dompdf_config.inc.php
中。如果它显示的是 false
而不是 true
,请进行更改。
is set in dompdf_config.inc.php
. If it reads false
instead of true
, change that.
这篇关于如何使DOMPDF逐步支持Unicode字体?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文