Closed Bug 1634572 Opened 5 years ago Closed 3 years ago

when blocking document fonts, exempt PDFs

Categories

(Firefox :: PDF Viewer, enhancement)

75 Branch
enhancement
Not set
normal

Tracking

()

RESOLVED DUPLICATE of bug 1563678

People

(Reporter: thorin, Unassigned)

References

Details

User Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:68.0) Gecko/20100101 Firefox/68.0

Steps to reproduce:

  • make sure browser.display.use_document_fonts = 1 (default: allowed)
  • open: https://www.nato.int/docu/presskit/010219/004gb.pdf
  • result: pdf text content displays fine
  • set browser.display.use_document_fonts = 0 (disallow)
  • reload the test
  • result: pdf is missing text, console warnings abound (see below)
  • Note: the problem does not occur with all PDFs
Warning: getPathGenerator - ignoring character: "Error: Requesting object that isn't resolved yet Times_path_U.". pdf.js:523:13
Warning: getPathGenerator - ignoring character: "Error: Requesting object that isn't resolved yet Times_path_N.". pdf.js:523:13
etc

This pref is the setting under General>Language and Appearance>Fonts & Colors>Advanced>Allow pages to choose...

I wouldn't necessarily call a PDF a (web) "page" - and for fingerprinting purposes (which is what the pref can be used for: I don't know what the original "intent" of the pref was), a PDF can't exactly enumerate fonts and exfil that data (AFAIK, but IANAE): so I think we could exempt them

Personally, I don't mind: if I see this, I just flick open a secondary Firefox which is more relaxed, but if it makes sense to reduce breakage, then by all means

Component: Untriaged → PDF Viewer

If I understand it correctly, the principal is currently resource://

Also: here's a PDF (from the same site) that does render text when document fonts are blocked

The difference hinges on whether the fonts were embedded in the PDF. Text using an embedded font is rendered to the canvas; text using a non-embedded built-in font (or webfont, presumably) is not.

Apparently a workaround was introduced in Firefox 24 to address this interaction in bug 738627 and https://github.com/mozilla/pdf.js/pull/3195 so I'm not sure why the issue has reemerged.

I can also see this issue with Debian's firefox 95.0.1-1 package.
https://www.dgdr.cnrs.fr/achats/agence/fichiers/Bonnes%20pratiques-Marche-Voyages-hebergement.pdf is also affected.

Dup of bug 1563678?

Vincent, is the issue in comment 4 that text is missing ? (if so, which text element is missing?), or do you mean that it looks different?

I would also think, this is a duplicate of 1563678.

Status: UNCONFIRMED → RESOLVED
Closed: 3 years ago
Flags: needinfo?(vincent-moz)
Resolution: --- → DUPLICATE

I don't see text missing. But the spacing between characters is bad and the characters are shifted to the right compared to the background in text selection.

Flags: needinfo?(vincent-moz)
You need to log in before you can comment on or make changes to this bug.