Stirling-PDF icon indicating copy to clipboard operation
Stirling-PDF copied to clipboard

Issue regarding Chinese fonts

Open jaychoubaby opened this issue 1 year ago • 18 comments

I converted it to PDF using Word, but the font is missing after conversion and the display is not normal.

image

jaychoubaby avatar Mar 14 '24 02:03 jaychoubaby

Can you give a example PDF file i can test this with to resolve?

Frooodle avatar Mar 14 '24 22:03 Frooodle

test.docx

This is a Chinese document, converting it to PDF will not display the characters.

Can you give a example PDF file i can test this with to resolve?

jaychoubaby avatar Mar 15 '24 01:03 jaychoubaby

I'm in the same boat. I'm having this problem

xxy0op avatar Mar 25 '24 13:03 xxy0op

I also encountered the same problem. It seems that the technology used has weak support for Chinese. I hope it can be fixed as soon as possible. Thank you so much.

Le1a avatar Mar 28 '24 06:03 Le1a

I have same issue with Thai language as well.

RasaElabram avatar Apr 01 '24 04:04 RasaElabram

I assume you are using docker. Under the directory /usr/share/fonts/opentype/noto/ there should be some fonts. Copy some of your own fonts (Chinese fonts maybe) into that will work. As of issue 974 you might need to delete noto and remake the directory first.

gepcel avatar Apr 01 '24 05:04 gepcel

I assume you are using docker. Under the directory /usr/share/fonts/opentype/noto/ there should be some fonts. Copy some of your own fonts (Chinese fonts maybe) into that will work. As of issue 974 you might need to delete noto and remake the directory first.

The method has been tested and proven effective. Thank you very much.

jaychoubaby avatar Apr 01 '24 06:04 jaychoubaby

I assume you are using docker. Under the directory /usr/share/fonts/opentype/noto/ there should be some fonts. Copy some of your own fonts (Chinese fonts maybe) into that will work. As of issue 974 you might need to delete noto and remake the directory first.

The method has been tested and proven effective. Thank you very much.

May I ask where you found the Chinese font files in the Word document?

Le1a avatar Apr 01 '24 09:04 Le1a

I assume you are using docker. Under the directory /usr/share/fonts/opentype/noto/ there should be some fonts. Copy some of your own fonts (Chinese fonts maybe) into that will work. As of issue 974 you might need to delete noto and remake the directory first.

The method has been tested and proven effective. Thank you very much.

Can you share some example fonts? Would love to add this directly to stirling pdf to support

Frooodle avatar Apr 01 '24 10:04 Frooodle

I assume you are using docker. Under the directory /usr/share/fonts/opentype/noto/ there should be some fonts. Copy some of your own fonts (Chinese fonts maybe) into that will work. As of issue 974 you might need to delete noto and remake the directory first.

The method has been tested and proven effective. Thank you very much.

Can you share some example fonts? Would love to add this directly to stirling pdf to support

Of course, I'll pack it for you tomorrow.

jaychoubaby avatar Apr 01 '24 10:04 jaychoubaby

May I ask where you found the Chinese font files in the Word document?

Since it's a word document, most likely created through Windows system. You can just copy those fonts being used from your system(C:\Windows\Fonts) into sterling-pdf docker, only for your own use.

Can you share some example fonts? Would love to add this directly to stirling pdf to support

Maybe to check if this or this fits.

gepcel avatar Apr 01 '24 11:04 gepcel

Does anyone have a example PDF file i can test with?

Frooodle avatar Apr 01 '24 17:04 Frooodle

I have released a update as well while i wait for test file If you can try with that

Frooodle avatar Apr 01 '24 21:04 Frooodle

我假设你正在使用 docker。该目录下/usr/share/fonts/opentype/noto/应该有一些字体。复制一些你自己的字体(也许是中文字体)进去就可以了。从问题 974开始,您可能需要noto先删除并重新创建目录。

该方法已经过测试并证明是有效的。非常感谢。

你能分享一些示例字体吗?很想将其直接添加到斯特林 pdf 中以支持

当然,我明天就给你打包。

https://drive.google.com/file/d/1aicHFA-3l32evIN79nmiadZBQNRdEZJz/view?usp=sharing

jaychoubaby avatar Apr 02 '24 03:04 jaychoubaby

Does anyone have a example PDF file i can test with?

阿里开发手册 word版阿里开发手册 word版.docx

jaychoubaby avatar Apr 02 '24 03:04 jaychoubaby

Does anyone have a example PDF file i can test with?

阿里开发手册 word版阿里开发手册 word版.docx

Seems to work now? :)

Frooodle avatar Apr 02 '24 21:04 Frooodle

I have added chinese now, but will be adding this via some env parameter in future as i cant install all fonts at start due to size issues

Frooodle avatar Apr 02 '24 21:04 Frooodle

I have added chinese now, but will be adding this via some env parameter in future as i cant install all fonts at start due to size issues

adding this via some env parameter is a good idea.

gepcel avatar Apr 02 '24 23:04 gepcel

https://github.com/Stirling-Tools/Stirling-PDF/blob/main/exampleYmlFiles/docker-compose-latest.yml#L24

Added a LANGS parameter, this will need to be specified going forward

for example LANGS: "zh_CN,zh_TW"

Frooodle avatar Apr 21 '24 22:04 Frooodle