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

Grabled text rendered with CID-keyed font #18062

Open
Amadeuss123 opened this issue May 10, 2024 · 0 comments
Open

Grabled text rendered with CID-keyed font #18062

Amadeuss123 opened this issue May 10, 2024 · 0 comments

Comments

@Amadeuss123
Copy link

Attach (recommended) or Link to PDF file here:
申请门店流程1.pdf

I have a strange document here that displays garbled text in pdf.js and Adobe, but displays correctly in Chrome. After analyzing the issue, I found that the cause is due to the font being a CID-keyed font, with the referenced CIDFontFile declared as CIDFontType2, but the actual format is OpenType instead of TrueType. This leads to pdf.js prioritizing the charset in the CFF when parsing the cmap, while ignoring the CIDToGIDMap Identity defined in the CIDFontFile. As a result, the browser fails to find the correct glyph during the rendering process.

What is the expected behavior? (add screenshot)
image

What went wrong? (add screenshot)
image

Here is some context info.

image image

And what is said in PDF specification 5.6.3 is shown as below:
image

I think in this situation, font type (here is CIDFontType2) should be considered first, rather than the format.

Looking forward to your answer.Thanks

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