Poor PDF font rendering with integrated Garamond

RESOLVED FIXED in Firefox 52

Status

()

Firefox
PDF Viewer
P3
normal
RESOLVED FIXED
2 years ago
a year ago

People

(Reporter: Milan Bouchet-Valat, Unassigned)

Tracking

44 Branch
Firefox 52
x86_64
Linux
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

(Whiteboard: [pdfjs-c-rendering][pdfjs-d-font-conversion][pdfjs-f-fixed-upstream] https://github.com/mozilla/pdf.js/pull/7639)

(Reporter)

Description

2 years ago
In the following PDF, fonts are rendered very poorly with pdf.js:
http://federation.ens.fr/ydepot/actua/JOURNE/2006_11_14/BOU06VIV.pdf

On the other hand, on the same system, Evince (poppler) gives very good results. The file uses Garamond, and Evince says the font is integrated. Yet, pdf.js seems to use a different font instead.

This is on Fedora 23, Firefox 44.0.2.
We're apparently failing to convert the fonts correctly, leading to them being rejected by OTS (OpenType Sanitiser), which is what causes the font issues.
The following is displayed in the console (using the development version of PDF.js):

> PDF f2a006f72c98f57e71334f8b286e334a [1.2 Corel PDF Engine Version 9.398 / POP90] (PDF.js: 1.4.107 [WebGL]) viewer.js:7135:7
> downloadable font: CFF: Failed validating charstring set 0 (font-family: "g_d0_f1" style:normal weight:normal stretch:normal src index:0) source: (invalid URI) <unknown>
> downloadable font: rejected by sanitizer (font-family: "g_d0_f1" style:normal weight:normal stretch:normal src index:0) source: (invalid URI) <unknown>
> downloadable font: font load failed (font-family: "g_d0_f1" style:normal weight:normal stretch:normal src index:0) source: (invalid URI) <unknown>
> Warning: Failed to load font ""g_d0_f1"": SyntaxError: An invalid or illegal string was specified pdf.js:368:5
> downloadable font: CFF: Failed validating charstring set 0 (font-family: "g_d0_f2" style:normal weight:normal stretch:normal src index:0) source: (invalid URI) <unknown>
> downloadable font: rejected by sanitizer (font-family: "g_d0_f2" style:normal weight:normal stretch:normal src index:0) source: (invalid URI) <unknown>
> downloadable font: font load failed (font-family: "g_d0_f2" style:normal weight:normal stretch:normal src index:0) source: (invalid URI) <unknown>
> Warning: Failed to load font ""g_d0_f2"": SyntaxError: An invalid or illegal string was specified pdf.js:368:5
> Warning: Failed to load font ""g_d0_f3"": SyntaxError: An invalid or illegal string was specified pdf.js:368:5
> downloadable font: CFF: Failed validating charstring set 0 (font-family: "g_d0_f3" style:normal weight:normal stretch:normal src index:0) source: (invalid URI) <unknown>
> downloadable font: rejected by sanitizer (font-family: "g_d0_f3" style:normal weight:normal stretch:normal src index:0) source: (invalid URI) <unknown>
> downloadable font: font load failed (font-family: "g_d0_f3" style:normal weight:normal stretch:normal src index:0) source: (invalid URI) <unknown>
> Warning: Failed to load font ""g_d0_f5"": SyntaxError: An invalid or illegal string was specified pdf.js:368:5
> downloadable font: CFF: Failed validating charstring set 0 (font-family: "g_d0_f5" style:normal weight:normal stretch:normal src index:0) source: (invalid URI) <unknown>
> downloadable font: rejected by sanitizer (font-family: "g_d0_f5" style:normal weight:normal stretch:normal src index:0) source: (invalid URI) <unknown>
> downloadable font: font load failed (font-family: "g_d0_f5" style:normal weight:normal stretch:normal src index:0) source: (invalid URI) <unknown>
Status: UNCONFIRMED → NEW
Ever confirmed: true

Updated

2 years ago
Priority: -- → P3
Whiteboard: [pdfjs-c-rendering][pdfjs-d-font-conversion]
Whiteboard: [pdfjs-c-rendering][pdfjs-d-font-conversion] → [pdfjs-c-rendering][pdfjs-d-font-conversion][pdfjs-f-fixed-upstream] https://github.com/mozilla/pdf.js/pull/7639
Depends on: 1306522
Status: NEW → RESOLVED
Last Resolved: a year ago
Resolution: --- → FIXED
Target Milestone: --- → Firefox 52
You need to log in before you can comment on or make changes to this bug.