TCPDF 字体转换导致字形丢失
我正在使用 TCPDF 库每天在 cronjob 中生成服务器端 PDF。该库从 DB 中获取 UTF8 字符串,并使用 Arial Unicode MS 字体将它们写入 PDF(也将其嵌入 PDF 中)。
为了能够使用这种字体,我必须按照以下说明将其转换为 PHP 友好的格式: http: //www.tcpdf.org/fonts.php
然而,虽然大多数语言看起来都是正确的(希伯来语、中文、日语、葡萄牙语等中的字形是正确的),但韩语字形在 PDF 中显示为方框。
我在运行上面链接中描述的 ttf2ufm 二进制文件时注意到许多(数百个)错误:
Previous entry type: M
Warning: **** closepath on empty path in glyph "_d_8235" ****
我怀疑这与此问题有关(无法正确转换这几百个字形,从而导致无效的字体文件)。
我做错了什么吗?或者这只是这个库的限制?
I'm using the TCPDF library to generate server-side PDFs daily in a cronjob. This library takes UTF8 strings from the DB and writes them into a PDF using the Arial Unicode MS font (also embedding it in the PDF).
To be able to use this font, I had to convert it to a PHP-friendly format following these instructions: http://www.tcpdf.org/fonts.php
However, while most of the languages seem right (glyphs are correct in Hebrew, Chinese, Japanese, Portuguese, etc.), Korean glyphs appear as squared boxes in the PDF.
I noticed many (hundreds of) errors while running the ttf2ufm
binary described in the link above:
Previous entry type: M
Warning: **** closepath on empty path in glyph "_d_8235" ****
I'm suspecting this has to do with this issue (not being able to correctly convert those couple of hundred glyphs, thus resulting in an invalid font file).
Am I doing something wrong? Or is this just a limitation of this library?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
最新的 TCPDF 版本使用 addTTFfont() 方法自动将字体转换为 TCPDF 格式。旧的字体程序和脚本已被删除。
例如:
The latest TCPDF version automatically convert fonts into TCPDF format using the addTTFfont() method. The old font programs and scripts were removed.
For example: