Skip to content

Grabled text rendered with CID-keyed font #18062

@Amadeuss123

Description

@Amadeuss123

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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions