Skip to content

[Bug]: Win7 numbers disappear #19977

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

Closed
948764321 opened this issue May 28, 2025 · 5 comments
Closed

[Bug]: Win7 numbers disappear #19977

948764321 opened this issue May 28, 2025 · 5 comments

Comments

@948764321
Copy link

Attach (recommended) or Link to PDF file

test2.pdf

Web browser and its version

Firefox/115.8

Operating system and its version

windows 7

PDF.js version

4.2

Is the bug present in the latest PDF.js version?

Yes

Is a browser extension

No

Steps to reproduce the problem

In the win7 environment, whether it is Google Chrome or Firefox Chrome, when opening this test file with pdf.js, the numbers cannot be displayed

What is the expected behavior?

Image

What went wrong?

Image

Link to a viewer

No response

Additional context

No response

@948764321
Copy link
Author

Through my investigation, this warning was thrown on new FontFace. Is it related to this

Image

@calixteman
Copy link
Contributor

WFM on Windows 11 with Firefox nightly and Firefox ESR (128.11.0).
It's very likely an issue with the Windows font rendering backend.
Microsoft ended WIndows 7 support 5 years ago (https://learn.microsoft.com/en-us/lifecycle/products/windows-7) so we won't fix this issue.
FYI, the displayed warning in the console is unrelated to your issue.

@948764321
Copy link
Author

WFM on Windows 11 with Firefox nightly and Firefox ESR (128.11.0). It's very likely an issue with the Windows font rendering backend. Microsoft ended WIndows 7 support 5 years ago (https://learn.microsoft.com/en-us/lifecycle/products/windows-7) so we won't fix this issue. FYI, the displayed warning in the console is unrelated to your issue.

Thank you for your reply. Could you please help me analyze where the problem lies? Thank you very much!
But if it is a problem of windows font,currently only PDf.js preview has problems. Under the same environment, it is normal to directly open the pdf preview with Google Chrome

@calixteman
Copy link
Contributor

Font issues are pretty hard to figure out especially when they're specific to an OS.
The fonts from the pdf are rewritten to make them suitable for the browser in fonts.js, so maybe there's something to tweak here.
The first thing you can try is to extract the font from the pdf (in using qpdf for example, take care the file you'll get can be compressed so you'd have to decompress it) then use ttx on it and try to see if there's something "unusual" or which looks suspicious. Once you find something which could be wrong, try to tweak it in fonts.js to see if it makes a difference (for example if a value is negative when it obviously must be positive, just try to clamp it or something like that before writing in the font data we'll pass to the browser).
Anyway, it's my way to fix this kind of bugs but maybe there's a better approach: I don't know.
I don't know what Chrome is using as a font backend on Windows.

@948764321
Copy link
Author

Thank you very much. I'll give it a try

谢谢🤞

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

No branches or pull requests

2 participants