TCPDF 在 Linux 客户端不显示中文 [英] TCPDF do not display Chinese on Linux client
问题描述
无论我使用什么字体,我都无法让 TCPD
显示任何汉字.
I cannot get TCPDF
display any chinese character no matter what font I am using.
我到处爬行和搜索,包括这些有趣的帖子
I crawled and searched everywhere I could, including these interesting posts
tcpdf-utf-8-problem
tcpdf-encode-chinese-character
但仍然没有成功.
TCPDF
中的示例 #7 可以很好地处理许多不同的字符集,但是如果我在文本中添加一些中文,它将显示为正方形,最奇怪的是如果我将字体更改为stsongstdlight
正如在一条消息中所建议的那样,文本根本不会显示 - 但标题会.
The sample #7 from TCPDF
works well with a lot of different characters sets but if I add some Chinese to the text it will display as squares and the strangest thing is if I change the font to stsongstdlight
as suggested in one message the text won't display at all - but the header will.
来自TCPPDF
的示例#38 日文字体也不起作用.感谢您提供任何可以让我找到新想法尝试的建议.
The sample #38 from TCPDF
with Japanese font doesn't work either.
Thanks for any advice that could let me find new ideas to try.
推荐答案
我刚刚测试了像
$pdf->SetFont('kozminproregular', '', 12);
如tcpdf 对中文字符进行编码中所建议的那样,它似乎工作正常.
as suggested in tcpdf encode chinese character and it seemed to work fine.
这是我的输出示例:
这篇关于TCPDF 在 Linux 客户端不显示中文的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!