I am attempting to create a PDF, using pdfmake, with Chinese characters. Specifically, I am using the NotoSansCJKsc-Regular.otf font. Setup: Chrome Version 62.0.3202.75, Windows 10.
The font renders correctly when the generated PDF is viewed in Microsoft Edge.
The font does not render correctly in Chrome - I just get blank characters displayed instead of Chinese. However, the characters do exist there; if I copy and paste the "blank" characters into another window, I see the correct characters.
The font behaves a little bit better in Adobe, however lots of characters are missing, and the rendering of lots of Latin characters is destroyed.
Is there a solution that will allow me to view the font correctly in Chrome or Adobe? I don't necessarily need to use the same font.
Is this a pdfmake problem or is it a problem with the font itself?
dorothythurston - Not sure.
We have resolved the issue by using the font KaigenSansSC-*.ttf (https://github.com/m13253/kaigen-fonts)
This is a TTF font that is converted from SourceHanSansSC-*.otf using the bash script found at https://github.com/caryll/otfcc-cubic2quad
By inspecting the pdfmake library, we expected that an OTF font would be converted to a TTF, and this would work, but for some reason the characters were still not rendering correctly. Supplying the library directly with a TTF font seems to do the trick. Perhaps this is a problem with the library; perhaps it is a problem with our understanding of it; perhaps it is a problem with the font we provided.
Pdfmake using pdfkit library for rendering PDF files, please create issue there. Thanks.
I want to know if I need to buy the copyright of KaigenSansSC-*.ttf ???
any update?
Should be fixed in latest release. If not, send a sample example to reproduce
Most helpful comment
dorothythurston - Not sure.
We have resolved the issue by using the font KaigenSansSC-*.ttf (https://github.com/m13253/kaigen-fonts)
This is a TTF font that is converted from SourceHanSansSC-*.otf using the bash script found at https://github.com/caryll/otfcc-cubic2quad
By inspecting the pdfmake library, we expected that an OTF font would be converted to a TTF, and this would work, but for some reason the characters were still not rendering correctly. Supplying the library directly with a TTF font seems to do the trick. Perhaps this is a problem with the library; perhaps it is a problem with our understanding of it; perhaps it is a problem with the font we provided.