Font rendering glitch with pdf viewer
Categories
(Firefox :: PDF Viewer, defect)
Tracking
()
People
(Reporter: ekr, Unassigned)
References
Details
(Whiteboard: [pdfjs-d-font-conversion])
Attachments
(1 file)
1.37 MB,
application/pdf
|
Details |
See:
https://www.cityofpaloalto.org/civicax/filebank/documents/8700
In the upper right corner "Purposes' has bad kerning. This looks correct in Preview.
Comment 1•4 years ago
|
||
It looks like there are a few things going on here and we'll need a heuristic.
The font file is not embedded and font name is a non standard font name (not one of the 14 that can be used without embedding). However, an older version of the PDF spec maps this font name to one of the standard fonts. Even if the name is fixed, the font in the PDF specifies a widths
array for the glyphs which we ignore for non-embedded fonts. If we don't ignore the widths then the PDF looks correct. Though then we get failures on other PDFs that don't embed the fonts.
To match acrobat we'll need to:
- add a map of non-standard to standard names
- use the widths array for a standard fonts
- ignore widths for non-standard fonts
FWIW, our current behavior matches pdfium.
Hmmm... we're seeing something that might be related, with PDFs produced by a partner's software. (Regrettably, I can't provide a sample of the problem, as they all contain personal information.) The partner says, "oh, we don't support Firefox", so we're trying to find the problem and tell them how to produced PDFs that work for Firefox too. Suspecting that it is some kind of previously-ignored error or spec discrepancy/ambiguity, which it sounds like this might be.
In our case, a few particular fields on the PDF are displayed in a very small type instead of the expected large one. Same PDF shows the expected text in Chrome or Acrobat Reader. And it's definitely a recent change, as older generated PDFs behave the same way, and continue to look as expected in older Firefox (e.g. latest ESR).
Ok, I was able to get one of these failing PDFs generated with fake personal data, so I'm attaching it here. If this is an entirely different issue, I can open a new Bug
Hmmm, also, FWIW, having copied this file to a company Box.com location, the Box PDF preview does not exhibit this bad font behavior in the same Firefox that does exhibit it when opening directly.
Sorry, "needinfo" is clearly not what I should have done. But I would like to hear where this issue is. It's affecting our customers.
Comment 6•4 years ago
|
||
This PR:
https://github.com/mozilla/pdf.js/pull/12831
will help to fix the font size issue in annotations.
Updated•4 years ago
|
Description
•