New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Characters cannot be displayed when use SimSun ttf font #843
Comments
Can you please provide links to both fonts you are having a problem with and a script to reproduce the issue? |
The font file in the Windows\Fonts folder, created a script as below:
|
I don't have access to a windows machine to get a copy of the fonts so I can try to reproduce the problem. I suspect we will find the problem is rooted in ttfunk which is the library prawn uses to deal with ttf fonts. Can you either help me find where I can get a copy of the fonts or confirm that ttfunk is able/unable to work with these specific fonts? |
The file size of simsunb.ttf is 16.1MB, I confirmed the issue is in ttfunk when comparing the result of simhei.ttf and simsunb.ttf by running ttfunk/examples/metrics.rb
With simsunb.ttf glyph id is 0 for all Chinese characters. |
Well, this issue is not urgent now. I found a tool called AiFont and converted c:/Windows/Fonts/simsun.ttc to simsun.ttf, then this ttf file can be used to render PDF correctly. |
Glad to hear you came up with a solution! I'll close this issue as it wasn't a prawn bug but ttfunk related. I would be happy to look at a PR to implement that functionality on the ttfunk side so the original font worked out of the box. Without the actual font file and spending some time in the TrueType spec, I won't be able to patch ttfunk myself. Thanks for the update! |
Used simsunb.ttf, 宋体, 新宋体, both fonts display square boxes.
The text was updated successfully, but these errors were encountered: