Closed Bug 1829498 Opened 2 years ago Closed 1 years ago

Built-in viewer for PDF (in Firefox for Android) mangles fonts

Categories

(GeckoView :: PDF Viewer, defect, P3)

Firefox 112
All
Android
defect

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: maxzzzz64, Unassigned)

References

Details

Attachments

(2 files)

User Agent: Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:109.0) Gecko/20100101 Firefox/112.0

Steps to reproduce:

Set Android display fonts to "Large"
Set in "Accessibility" setting in Firefox for Android either "Automatic Font sizing" (namely it follows Android setting) or a percentage different from 100% in "Font Size"

Actual results:

The fonts are seen in built-in PDF viewer distorted, mangled and pretty much unreadable. Thus, you really need to download the PDF to read them.
In fact, recent update of Firefox for Android introduced the possibility to view PDFs directly in-browser, no need to download them.
Unfortunately the "font viewing" is only nice when you just leave the font size setting to 100% in Accessibility settings. If you either set viewing size to e.g. 130% or set to adapt the font size to Android setting in Firefox for Android settings (namely in "accessibility"), you get a very bad PDF viewing, with mangled fonts and character overlapped each other.

Attached image image.png

It can be easily reproduced in an android emulator.
I just opened https://www.africau.edu/images/default/sample.pdf in Fenix and set the font scale factor in accessibility menu to 150%.
It's likely related to:
https://searchfox.org/mozilla-central/rev/e6cb503ac22402421186e7488d4250cc1c5fecab/dom/canvas/CanvasRenderingContext2D.cpp#3549-3564
and this issue is pretty similar to bug 698652 which is mentioned in the comment.

:emilio or :jfkthame could you have a look please ?

Flags: needinfo?(jfkthame)
Flags: needinfo?(emilio)
Severity: -- → S3
Component: General → PDF Viewer
Priority: -- → P3
Product: Fenix → GeckoView

Oh, so this looks like some extra text-only zoom. I wasn't even aware this was a thing. So Calixte, this is related to bug 1830746. Turns out that the reason why text-only zoom doesn't exhibit the same issue is because desktop has some specialness for pdf.js here.

But it probably can be reproduced if you remove that in desktop with text only zoom. The way this is hooked in is outdated, we have a LookAndFeel::IntID::TextScaleFactor which is the right way of passing this to Gecko.

Flags: needinfo?(emilio)

Calixte, is there still an issue here, or is this resolved now that bug 1831136 is fixed?

Flags: needinfo?(jfkthame) → needinfo?(cdenizet)

It's fixed now.

Status: UNCONFIRMED → RESOLVED
Closed: 1 years ago
Flags: needinfo?(cdenizet)
Resolution: --- → FIXED

Sorry, Calixte to dissappoint you: I checked immediately if it was true, but the issue is NOT resolved at all.
The text is still mangled the same way it was when I open the issue 27 days ago.

Status: RESOLVED → UNCONFIRMED
Resolution: FIXED → ---

maxzzzz64, could you please confirm exactly what version of Firefox you're using? Note that the fix from bug 1831136 is currently only present in the Nightly version (115), not in the standard release version (113).

Flags: needinfo?(maxzzzz64)

If you don't use Firefox nightly, you can install it from:
https://play.google.com/store/apps/details?id=org.mozilla.fenix&hl=fr&gl=US

On your suggestions, I tried 115 Nightly and it works with this version.
I still confirm what written by Jonathan Kew that the fix is not present in standard version 113, because it is not working with that version

Status: UNCONFIRMED → RESOLVED
Closed: 1 years ago1 years ago
Resolution: --- → FIXED
Flags: needinfo?(maxzzzz64)
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: