Firefox PDF font rendering is often messed up

Bug #1971608 reported by Rahul
28
This bug affects 6 people
Affects Status Importance Assigned to Milestone
Mozilla Firefox
Invalid
Unknown
firefox (Ubuntu)
Fix Committed
High
Unassigned

Bug Description

I don't know whether it is an ubuntu bug or a firefox bug but since I am running the mozilla-supported ubuntu snap of firefox 99.0.1 (on 22.04 jammy) (firefox 100 not yet available on snap), posting it here.

Many pdfs have messed-up fonts on this firefox. Following a reddit thread, I tried disabling browser.display.use_document_fonts in about:config. Then the pdfs render correctly, but html webpages have messed-up fonts.

Reddit post with screenshots and sample URL here; previous reddit thread linked therein.
https://www.reddit.com/r/firefox/comments/uhz6d1/continued_messedup_font_rendering_in_firefox_pdf/

Others (on this and previous thread) report it doesn't happen on other platforms. On this thread, someone confirms it on a Ubuntu VM, and someone else says it doesn't happen on Mint (based on Ubuntu but I think doesn't use snaps).

Tags: jammy
Revision history for this message
In , neo (csae2608) wrote :

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

Steps to reproduce:

open PDF in Firefox under Linux Ubuntu 18.04 via website

https://web.archive.org/web/20011111104216/http://www.lungusa.org/air/pdf/pm01_rep.pdf

https://web.archive.org/web/20011111104402/http://www.lungusa.org/air/pdf/ozone01_rep.pdf

Actual results:

poor fonts are being displayed

Expected results:

should have included "original" fonts by default?

this could be achieved after going to

about:config (in adress bar)
setting "browser.display.use_document_fonts" to "0" instead of "1"

should be default behaviour, or am i wrong?

Revision history for this message
In , Release-mgmt-account-bot (release-mgmt-account-bot) wrote :

The [Bugbug](https://github.com/mozilla/bugbug/) bot thinks this bug should belong to the 'Firefox::PDF Viewer' component, and is moving the bug to that component. Please revert this change in case you think the bot is wrong.

Revision history for this message
In , Mcastelluccio (mcastelluccio) wrote :

Pretty sure there is already a bug around about this.

Revision history for this message
In , Ada-cristea (ada-cristea) wrote :

Thanks for reporting!

I tried to reproduce this issue using Firefox 91.5.1esr and Beta 97 on Ubuntu 20.04, but unfortunately I didn’t manage to recreate the situation.
Upon changing the setting "browser.display.use_document_fonts" to "0" instead of "1" though, using Firefox 91.5.1esr, I refreshed the web pages and the pages were blank.

Can you please mention the Firefox version you're using? And can you also attach a screenshot of the occurring issue?

Revision history for this message
In , Mcastelluccio (mcastelluccio) wrote :

(In reply to Marco Castelluccio [:marco] from comment #2)
> Pretty sure there is already a bug around about this.

There's actually bug 1563678, but it seems to be the opposite.

Revision history for this message
In , neo (csae2608) wrote :

Hello,
i made some screenshot,
please see the difference (in readability)

with setting "0" (user-set)
https://ibb.co/d7PnX0f
https://ibb.co/0pNdLxL
https://ibb.co/SQKxVLk

with setting "1" (standard, firefox 91.5 esr, 64bit, ubuntu 18.04 LTS)
https://ibb.co/z7617DY
https://ibb.co/FVnZZDQ
https://ibb.co/NKkMmVw

Thanks.

Revision history for this message
In , Ada-cristea (ada-cristea) wrote :

Thank you for the reply!

I will mark this issue as NEW since I managed to reproduce it on Ubuntu 18.04 using Firefox 91.5.1esr, Firefox 96 and Nightly 98.0a1.
The issue was not reproducible on Ubuntu 20.04 though.

Revision history for this message
In , Release-mgmt-account-bot (release-mgmt-account-bot) wrote :

Change the status for beta to have the same as nightly and release.
For more information, please visit [auto_nag documentation](https://wiki.mozilla.org/Release_Management/autonag#missing_beta_status.py).

Revision history for this message
In , neo (csae2608) wrote :

can confirm that this issue occurs on several other sites aswell, basically alot of PDF i opened "randomly" were affected,

glad that this issue is no more present in Ubuntu 20.04. thanks very much for your time & help.

Revision history for this message
In , neo (csae2608) wrote :
Changed in firefox (Ubuntu):
status: New → Invalid
Revision history for this message
In , Rahul-siddharthan (rahul-siddharthan) wrote :

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

Steps to reproduce:

My setup is Firefox 99.0.1 snap on Ubuntu 22.04 Jammy. I filed an Ubuntu bug but they said the firefox snap is from upstream and sent me here.
I opened http://www.wormbook.org/chapters/www_intromethodscellbiology/intromethodscellbiology.pdf and the fonts are wrong and spacing is ugly.

Over on reddit people suggested disabling use document fonts (browser.display.use_document_fonts=0) and that fixed it; but for html pages it uses the wrong fonts then.

Also on reddit, someone said reproducible in a Ubuntu VM; someone else said, not reproducible on Linux Mint, which is based on Ubuntu but doesn't use snaps.

Actual results:

Ugly fonts. Results in first image here
https://www.reddit.com/r/firefox/comments/uhz6d1/continued_messedup_font_rendering_in_firefox_pdf/

Expected results:

Beautiful fonts. Second image here
https://www.reddit.com/r/firefox/comments/uhz6d1/continued_messedup_font_rendering_in_firefox_pdf/

Revision history for this message
Erich Eickmeyer (eeickmeyer) wrote :

Thank you for taking the time to report this bug and help make Ubuntu better. Firefox is provided by a snap published by Mozilla, and they may not be aware of this issue. Please contact them via https://support.mozilla.org/kb/file-bug-report-or-feature-request-mozilla and link the bug report here so it can be further tracked, then re-mark the bug as new. Thank you!

Changed in firefox (Ubuntu):
status: Invalid → Incomplete
Rahul (rsidd120)
Changed in firefox (Ubuntu):
status: Incomplete → New
Revision history for this message
In , Rahul-siddharthan (rahul-siddharthan) wrote :

Update: the bug remains in firefox 100.

Revision history for this message
Rahul (rsidd120) wrote :

Thank you for changing the "invalid" status. Here is the upstream bug report https://bugzilla.mozilla.org/show_bug.cgi?id=1767925

Since it is not seen by mint users I am guessing it is an issue with snap.

I just updated to firefox 100 (ubuntu snap), the bug remains.

Revision history for this message
Sebastien Bacher (seb128) wrote :

Thanks for reporting the issue upstream. Could you check if firefox prints any warning when showing the document, if started from a cmdline?

could you do

$ journalctl -f

display the pdf, and copy here any warning that could be displayed in the log?

Changed in firefox (Ubuntu):
importance: Undecided → High
status: New → Triaged
Changed in firefox:
status: Unknown → New
Revision history for this message
Rahul (rsidd120) wrote :

In the firefox terminal, I see only
ATTENTION: default value of option mesa_glthread overridden by environment.
(repeated twice)
In the journalctl terminal I see
May 06 14:48:47 courtandspark rtkit-daemon[1851]: Supervising 2 threads of 2 processes of 1 users.
repeated many times

Revision history for this message
In , Athaleaseem (athaleaseem) wrote :

Do you have `gsfonts` installed on your system? I had the same problem, but I fixed it by installing gsfonts.

Revision history for this message
In , Rahul-siddharthan (rahul-siddharthan) wrote :

I do have gsfonts installed, version 1:8.11+urwcyr1.0.7~pre44-4.5 . As noted, the font rendering is fine if I disable "browser.display.use_document_fonts". So it is not a missing font problem.

Revision history for this message
In , Rahul-siddharthan (rahul-siddharthan) wrote :

Update: this problem does not occur with firefox-trunk (version 101.0a1), which is installed via apt. I strongly suspect it is a problem with the snap packaging of firefox.

Revision history for this message
Rahul (rsidd120) wrote :

Update: this problem does not occur with firefox-trunk (version 101.0a1), which is installed via apt. I strongly suspect it is a problem with the snap packaging of firefox.

Revision history for this message
In , Epopescu (epopescu) wrote :

I've managed to reproduce this issue using Firefox 100.0.1 Snap on Ubuntu 22.04.
Marking this as dupe because it has been already reported in bug 1752414.

*** This bug has been marked as a duplicate of bug 1752414 ***

Revision history for this message
In , Epopescu (epopescu) wrote :

*** Bug 1767925 has been marked as a duplicate of this bug. ***

Revision history for this message
In , Epopescu (epopescu) wrote :

*** Bug 1768783 has been marked as a duplicate of this bug. ***

Changed in firefox:
status: New → Invalid
Revision history for this message
Sebastien Bacher (seb128) wrote :

One of the upstream reports mentions having a similar issue with the deb until installing gsfonts, unsure if that's a valid hint on what the env difference could be though

madbiologist (me-again)
tags: added: jammy
Olivier Tilloy (osomon)
Changed in firefox:
status: Invalid → Unknown
Changed in firefox:
status: Unknown → Confirmed
Revision history for this message
Miguel Rodríguez (migrax) wrote :

I think the issue is that the firefox snap is not able to find substitutes for the default pdf fonts when they are not embedded in the document. PDF documents with embedded fonts render fine with the snap.

Revision history for this message
Rahul (rsidd120) wrote :

I uninstalled the snap and installed the deb via the mozillateam ppa. It works fine. Definitely a snap problem.

Revision history for this message
In , Rahul-siddharthan (rahul-siddharthan) wrote :

I had filed bug 1767925, which was closed as a duplicate of this. That bug is specific to the snap on ubuntu. I have switched back to the deb via the mozillateam ppa, purely because of this issue. The deb works fine. The problem seems to be that the snap is not able to find fonts which are on the system but not embedded in the pdf. In other words it's an ubuntu snap packaging bug, not a firefox bug.

Revision history for this message
In , Mcastelluccio (mcastelluccio) wrote :

(In reply to rahul.siddharthan from comment #12)
> I had filed bug 1767925, which was closed as a duplicate of this. That bug is specific to the snap on ubuntu. I have switched back to the deb via the mozillateam ppa, purely because of this issue. The deb works fine. The problem seems to be that the snap is not able to find fonts which are on the system but not embedded in the pdf. In other words it's an ubuntu snap packaging bug, not a firefox bug.

Thanks for the info, I've reopened bug 1767925 and marked it as blocking the meta bug tracking all Snap issues.

Revision history for this message
In , Cdenizet (cdenizet) wrote :

*** Bug 1767925 has been marked as a duplicate of this bug. ***

Revision history for this message
Sebastien Bacher (seb128) wrote :

The issue is being discussed on https://github.com/ubuntu/gnome-sdk/issues/49 now, one workaround is to do

$ mkdir ~/snap/firefox/current/.config/fontconfig/conf.d; cp /etc/fonts/conf.d/* ~/snap/firefox/current/.config/fontconfig/conf.d

Revision history for this message
Sebastien Bacher (seb128) wrote :

that's fixed in the gnome-3-38-2004 candidate snap now

Changed in firefox (Ubuntu):
status: Triaged → Fix Committed
Revision history for this message
In , Mcastelluccio (mcastelluccio) wrote :

Are you still able to reproduce this with latest Nightly? It might have been fixed by https://github.com/mozilla/pdf.js/pull/16363 or https://github.com/mozilla/pdf.js/pull/16416.

Revision history for this message
In , Gon Solo (gonsolo) wrote :

I tried the two pdfs in the original report as well as the pdf in my (duplicate) bug report 1768783, and they all render correctly with 113.0.1 on Ubuntu. Thanks very much. :)

Revision history for this message
In , Mcastelluccio (mcastelluccio) wrote :

Thanks! Marking this as duplicate of bug 1766039 then.

*** This bug has been marked as a duplicate of bug 1766039 ***

Changed in firefox:
status: Confirmed → Invalid
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.