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 for Unicode text strings #15

Open
mvx24 opened this issue Mar 14, 2017 · 2 comments
Open

Support for Unicode text strings #15

mvx24 opened this issue Mar 14, 2017 · 2 comments

Comments

@mvx24
Copy link

mvx24 commented Mar 14, 2017

I've tried forking and outputting text using UTF-16BE that PDFs support but can't seem to get it to render without interpreting the two-byte chars as two different characters. Maybe it is a font issue. Do you have interest in fixing or should I migrate to report lab or something similar?

@katerina7479
Copy link
Owner

Oooh, interesting. I can look into it, maybe this weekend. Can you share an example of what you are trying?

@mvx24
Copy link
Author

mvx24 commented Mar 17, 2017

I saved my work on a new branch. But couldn't get it working 100%. According to the pdf spec, the idea is to put UTF-16BE with a BOM inside the (text string) Tj part but when the pdf renders each wide 16bit character is instead interpreted as two 8bit characters so you see spaces everywhere. When looking at the hex dump of the file all output is as expected which leads me to believe there is something I'm missing with the spec. Perhaps it has to do with the truetype CID fonts. Maybe it is required to embed them? The example I was trying to get working was courier which I believe should have just been pulling from the system and not embedded.

Here's what I changed:

master...mvx24:unicode

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

2 participants