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 Chinese characters #1

Open
liuhui-666666 opened this issue Jun 12, 2024 · 3 comments
Open

support for Chinese characters #1

liuhui-666666 opened this issue Jun 12, 2024 · 3 comments
Labels
enhancement New feature or request

Comments

@liuhui-666666
Copy link

"How can the garbled code issue in the PDF export of Chinese labels within nodes be resolved?"

@mikekucera
Copy link
Collaborator

Can you provide an example or reusable test case? JSBin is a good option for this.

The pdf-export extension relies on PDFKit to render text, and PDFKit only provides a handful of fonts. I just want to set expectations that this might not be resolvable, but I can look into it.

@liuhui-666666
Copy link
Author

"This is rendered using Cytoscape.js, where I have drawn graphs with node labels in both Chinese and English. The first graph can be normally exported as a cy .png file, but when converted to PDF, as shown in the second image, the Chinese characters are garbled."

1

2

@mikekucera
Copy link
Collaborator

Thanks for providing the issue report. Currently cytoscape-pdf-export only provides a small number of fonts that come with PDFKit (see the README file for details). I assume these fonts don't support Chinese characters. I believe someone will need to implement a feature where users can provide their own fonts. Since the fonts are embedded as part of the build process that could be a bit involved. I can implement such a feature but I won't be able to start for some time. PRs are of course welcome.

@mikekucera mikekucera added the enhancement New feature or request label Jun 13, 2024
@mikekucera mikekucera changed the title PDF export encoding issue support for Chinese characters Jun 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants