Skip to content
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

Support cyrillic characters #20

Open
focused opened this issue Jul 20, 2020 · 5 comments
Open

Support cyrillic characters #20

focused opened this issue Jul 20, 2020 · 5 comments

Comments

@focused
Copy link

focused commented Jul 20, 2020

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?

@andrewtimberlake
Copy link
Owner

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.

@focused
Copy link
Author

focused commented Jul 21, 2020

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?

@andrewtimberlake
Copy link
Owner

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.

@Hermanverschooten
Copy link
Contributor

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.

@camelpunch
Copy link

If you're here looking for special character support, I've started a PDF generator with a different approach. It avoids the GenServer and has support for OTF fonts and special characters via the OpenType library. Early stages, but fills a gap we had at work to create PDFs in a pure function, with special characters, custom fonts and images.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants