elixir-pdf
elixir-pdf copied to clipboard
Support cyrillic characters
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?
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.
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?
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.
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.