Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Chinese font not displayed #14759

Closed
123woscc opened this issue Apr 7, 2022 · 4 comments · Fixed by #15900
Closed

Chinese font not displayed #14759

123woscc opened this issue Apr 7, 2022 · 4 comments · Fixed by #15900

Comments

@123woscc
Copy link

123woscc commented Apr 7, 2022

Attach (recommended) or Link to PDF file here:
GM/T 0016-2012 智能密码钥匙密码应用接口规范(1).pdf

Configuration:

  • Web browser and its version: Microsoft Edge 99.0.1150.39
  • Operating system and its version: Windows 10
  • PDF.js version: v2.13.216
  • Is a browser extension: No

Steps to reproduce the problem:

  1. Open the PDF with pdf.js.
  2. Found the text of this PDF disappeared.

What is the expected behavior? (add screenshot)
Open with browser built-in viewer
image

What went wrong? (add screenshot)
Open with pdf.js online demo https://mozilla.github.io/pdf.js/web/viewer.html
image
image

Link to a viewer (if hosted on a site other than mozilla.github.io/pdf.js or as Firefox/Chrome extension):

@Snuffleupagus
Copy link
Collaborator

Snuffleupagus commented Apr 7, 2022

issue14759_reduced.pdf

Interestingly it works fine with disableFontFace = true set, which suggests that the browser (or possibly OTS) is rejecting the font. However, there are no font-related error messages printed in the console.

Edit: When running the font-file, that PDF.js creates, through ttx it seems to stop at the following assert:
https://github.com/fonttools/fonttools/blob/7ee2c9d8918be4158340ca584996ef13cbe9cd84/Lib/fontTools/cffLib/__init__.py#L1572

@123woscc
Copy link
Author

123woscc commented Apr 7, 2022

Yes, I've also found that disableFontFace = true to display fine. but this will cause other files to fail to display.
image
Might be easier to handle if it could throw a font-related error.

@dunduenrzc
Copy link

I also encounter the same problem. Do you have a solution @123woscc

@mozilla mozilla deleted a comment from syczuan May 9, 2022
@Snuffleupagus
Copy link
Collaborator

Fixed by PR #15900.

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

Successfully merging a pull request may close this issue.

3 participants