elixir-pdf icon indicating copy to clipboard operation
elixir-pdf copied to clipboard

Support cyrillic characters

Open focused opened this issue 4 years ago • 4 comments

I tried to render Cyrillic text in document, but it renders nothing. How can I do it with current implementation? If there is no support, is it possible to implement this feature, how can I contribute?

focused avatar Jul 20 '20 15:07 focused

I have not added UTF-8 support. The PDF format does not have intuitive support for UTF-8, at least not as easy as Elixir ;-) Right now the only character support I have included is support for WinANSI encoding and the code translates the UTF-8 characters that are supported into that encoding. Feel free to tackle any aspect of encoding, font-mapping, or UTF-8 support.

andrewtimberlake avatar Jul 21 '20 04:07 andrewtimberlake

If I understand you correctly we need the module that supports UTF-8 in addition to Pdf.Encoding.WinAnsi. Can you give me a direction where I can start?

focused avatar Jul 21 '20 08:07 focused

I’m sorry I don’t have time at this point. The PDF spec is available online but it is quite a monster. One of the things I’m sure would be needed is TTF font support in order to be able to handle the UTF-8 characters but I haven’t really looked into it in depth.

andrewtimberlake avatar Jul 27 '20 17:07 andrewtimberlake

I am currently working on an TTF parser, based on the ttfunk gem. But it is a lot of work. You can check my progress in the repo. Once this is complete, we can see how to integrate it.

Hermanverschooten avatar Dec 07 '20 16:12 Hermanverschooten