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

Copy-paste not working for rendered glyphs #17

Open
diegomura opened this issue Mar 27, 2018 · 5 comments
Open

Copy-paste not working for rendered glyphs #17

diegomura opened this issue Mar 27, 2018 · 5 comments

Comments

@diegomura
Copy link
Collaborator

As explained here #15, copy pasting text from documents created with the TextRendeder is not working. Devon pointed out the cause of the issue, but it will require q bit more research from my side to solve it

@diegomura
Copy link
Collaborator Author

diegomura commented Mar 29, 2018

Seems to me that this can be solved by passing by glyphs with the correct codePoints field to pdfkit _addGlyphs. However, the fontkit string-indices branch erases this field from Glyph.

@devongovett why did you do that? If present, we can use codePoints to fill in unicode values on pdfkit side and solve this issue, right?

@diegomura
Copy link
Collaborator Author

@devongovett sorry for bothering you! But I'm stuck in here. How can I do to access a glyph codePoints now that it's not part of Glyph attributes anymore? I need this data to fix copy-pasting on pdfkit and encode glyphs for standard fonts. Thanks in advance!

@devongovett
Copy link
Member

You'd need the original string that the glyphs were constructed with, and the string indexes of the glyphs. Then you can just slice the string to get the code points.

@diegomura
Copy link
Collaborator Author

Thanks for your answer!
So you suggest to pass codePoints to the _addGlyphs method?

@devongovett
Copy link
Member

yep

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