Closed asavchuk closed 5 years ago
This is really a gofpdf question I think. I'm out of town without a computer now. If you don't get an answer by the time I get back, I'll look at it. After mid September...
On Sat, Sep 7, 2019, 1:00 PM André notifications@github.com wrote:
source Влюбиться можно в красоту, но полюбить – лишь только душу!
result ВлюбитÑOEÑ•Ñ• можно в краѕоту, но полюбитÑOE – лишÑOE толÑOEко душу!
This is how it makes text if with non latin characters. A required font is in the project folder and the font name is used in Styler options. How to fix it?
— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/mandolyte/mdtopdf/issues/10?email_source=notifications&email_token=AAJ2ZXNHESN4JDWVI7OQQP3QIPM3LA5CNFSM4IUQVFS2YY3PNVWWK3TUL52HS4DFUVEXG43VMWVGG33NNVSW45C7NFSM4HJ623PQ, or mute the thread https://github.com/notifications/unsubscribe-auth/AAJ2ZXOZ33O7EXHCQJPWGILQIPM3LANCNFSM4IUQVFSQ .
here is a minimal example
https://gist.github.com/asavchuk/6743179b5dabac1cd7714d7f6255df6c
The gist code is using the font Arial. I think you need a font that supports the glyphs needed for the language. Do you know of a font that does work? Not sure my code provides access to the "non standard fonts" as described below. Need some time to consider... But I thought I'd give you an update.
The Arial font I used supports glyphs of the needed language. If you need other font to try you could use this one https://github.com/googlefonts/AmaticSC/blob/master/fonts/ttf/AmaticSC-Regular.ttf It works with https://github.com/signintech/gopdf
Thanks. I finally got gofpdf to work with Russian (https://gist.github.com/mandolyte/8cfcf664567eb098e762c668dac16782). Now I'll see what needs to be with my code to enable this. I used the Helvetica 1251 font provided by the gofpdf project. Let me know if you see anything else about this problem that would help.
I have filed an issue with the blackfriday markdown parser project: #russross/blackfriday#569
Their parser accepts only []byte as input and I don't see any way to workaround this.
Better understanding of how to use the PDF generator to apply fonts, codepages and then to use those in this package resulted in a solution.
The README now documents (at the end) how to do it. And the cmd
folder has a complete working example using Russian. The example code is russian.go
source Влюбиться можно в красоту, но полюбить – лишь только душу!
result ВлюбитÑOEÑ•Ñ• можно в краѕоту, но полюбитÑOE – лишÑOE толÑOEко душу!
This is how it makes text with non latin characters. A required font is in the project folder and the font name is used in Styler options. How to fix it?