When browser.display.use_document_fonts=0, pdf.js missing some text
Categories
(Firefox :: PDF Viewer, defect)
Tracking
()
People
(Reporter: nyanpasu64, Assigned: Snuffleupagus)
References
(Regression)
Details
(Keywords: regression)
Attachments
(1 file)
55.77 KB,
application/pdf
|
Details |
User Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:79.0) Gecko/20100101 Firefox/79.0
Steps to reproduce:
- In about:config, set browser.display.use_document_fonts to 0
- Visit a PDF file like http://www.aprs.org/doc/APRS101.PDF
Actual results:
Some text is missing. All text in Times/Arial Regular is present, and all text in bold/italic is missing.
If I open the PDF in Windows Okular, Times New Roman Regular and Arial Regular are embedded fonts and show up in pdf.js. Whereas the bold and italic variants use the system font in Okular, and are invisible in pdf.js.
Expected results:
All text is visible.
Comment 1•4 years ago
|
||
Bugbug thinks this bug should belong to this component, but please revert this change in case of error.
Comment 2•4 years ago
|
||
I suspect this is a pdf.js issue rather than a core platform bug. Drawing text using the canvas2d fillText API (which is what pdf.js normally does) still works when use_document_fonts is disabled (although it'll appear via a generic fallback font rather than whatever was set on the canvas context).
But AFAICT pdf.js doesn't use the fillText method at all when use_document_fonts is turned off; presumably it detects this, knows that the rendering won't be reliable if it can't control the font, and takes an entirely different path (I suspect it's rasterizing glyphs itself from the font resources embedded in the PDF).
I guess this doesn't work with installed system fonts, only with PDF-embedded resources, probably because pdf.js doesn't have access to the actual font data for system fonts.
Comment 3•4 years ago
|
||
The severity field is not set for this bug.
:bdahl, could you have a look please?
For more information, please visit auto_nag documentation.
Updated•4 years ago
|
I'm also seeing this in Firefox and Thunderbird. I searched several hours for the reason. It turned out the issue was, "browser.display.use_document_fonts" was set to 0.
I've attached a test file to reproduce this issue. First, set ("browser.display.use_document_fonts", 0) and then open this PDF in Firefox (or Thunderbird). I am seeing this on macOS. And Firefox 85.
The console shows several warnings like:
Warning: getPathGenerator - ignoring character: "Error: Requesting object that isn't resolved yet Helvetica_path_b.". pdf.js:1127:13
Comment 5•4 years ago
|
||
I can reproduce the issue on Nightly87 Windows10.
#1 Regression window(forever spinning loading spinner):
https://hg.mozilla.org/mozilla-central/pushloghtml?fromchange=5bf126434fac78a31256c994b9dbf4b1031b0350&tochange=c03413e3a8233d7ea0afff73717e1cdeae39fa49
Suspect: 7d8a99f5f75971f38acf666db47d178a7b47abf4 Brendan Dahl — Bug 1444499 - Update pdf.js to version 2.0.447. r=yury
#2 Partial fix window(font not rendered):
https://hg.mozilla.org/mozilla-central/pushloghtml?fromchange=4432fb67de2d1e2658a36fed800979c1968c1f94&tochange=257c191e7903523a1132e04460a0b2460d950809
Suspect: 280327567bdf4ec76081a97c63dc1ec9f76550c7 Ryan VanderMeulen — Bug 1469362 - Update pdf.js to version 2.0.602. r=bdahl
Updated•4 years ago
|
Fixed by
Bug 1718101 - Update pdf.js to version 2.10.199 r=calixte
Differential Revision: https://phabricator.services.mozilla.com/D118734
Works for me with Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:97.0) Gecko/20100101 Firefox/97.0
Comment 7•3 years ago
|
||
One of the fixes in the pdf.js 2.10.199 update was
#13587 Set the default value of useSystemFonts correctly, depending on disableFontFace, in the API (PR 13516 follow-up)
which sounds like it was presumably the issue happening here.
Dup'ing to bug 1718101, where the fix landed.
Comment 9•3 years ago
|
||
(In reply to Jonathan Kew (:jfkthame) from comment #7)
Dup'ing to bug 1718101, where the fix landed.
*** This bug has been marked as a duplicate of bug 1718101 ***
We usually close the bugs as FIXED and mark them as depending on the PDF.js update.
Updated•3 years ago
|
Description
•