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

Chinese character incorrectly encoded when copied from generated PDF using 'Adobe Source Han' serif/sans font | 内置PDF导出含思源宋/黑字体时有特定字符无法正确复制 #6029

Open
2 of 3 tasks
klizet opened this issue Apr 15, 2024 · 3 comments

Comments

@klizet
Copy link

klizet commented Apr 15, 2024

  • Searched existing issues to avoid creating duplicates.

  • Confirmed that it can be reproduced in built-in themes without customized css.

  • Searched http://support.typora.io/


Describe the bug
Some Chinese characters eg. '一'、'二' incorrectly encoded when copied from generated PDF using 'Adobe Source Han' serif/sans font.

To Reproduce
Steps to reproduce the behavior:

  1. Modify some 3rd typora theme to specify the font to 'Adobe Source Han serif'/思源宋体 or 'Adobe Source Han sans'/思源黑体.
  2. Simply type in '一二三四五六七八九十'.
  3. Export as a pdf file.
  4. Copy the text in the pdf file, but the characters will change to '⼀⼆三四五六七⼋九⼗'. Note the characters '⼀⼆⼋⼗' are different from original inputs even they look similar.

Expected behavior
Characters copied from the pdf should be exactly consistent with the original input.

Screenshots / Screencasts
Omitted.

Sample Markdown File
Omitted.

Desktop (please complete the following information):

  • OS: Windows 11 64bit

Typora Version
1.8.10 in release channel.

Additional context

The issue is also discussed here but related to itext library or html2pdf program.
https://www.v2ex.com/t/965813 (in Chinese)
https://juejin.cn/post/6844903729439703053 (in Chinese)

This bug may be related to the upstream libraries of typora program. But, until this bug gets officially fixed, there are many ways to do a quick fix, for people who bothered.

@abnerlee
Copy link
Contributor

Typora uses Chromium's built-in PDF generation method, so, if you export the md to html, open it in Chrome and print as PDF, does the same bug occur?

@klizet
Copy link
Author

klizet commented Apr 19, 2024

Sure, you are correct. This bug is reproduced by the edge browser. At the same time, the built-in 'Save as pdf' function of firefox, and the virtual pdf printer of windows 'Print as PDF' works well without any issue.

After checking the chromium issue tracker, I found it's related to the bug 41469265 but marked as fixed. I will re-issue this to the chromium maintainers some days later.

@klizet
Copy link
Author

klizet commented Apr 19, 2024

It can be traced into the skia library, a very low level infra of chromium here. Perhaps it WONT BE FIX in a short time. Sad.

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

No branches or pull requests

2 participants