Bug 32525 - fontconfig update address i.e rendering of some PDF fonts in Firefox and Thunderbird
Summary: fontconfig update address i.e rendering of some PDF fonts in Firefox and Thun...
Status: RESOLVED FIXED
Alias: None
Product: Mageia
Classification: Unclassified
Component: RPM Packages (show other bugs)
Version: 9
Hardware: All Linux
Priority: Normal normal
Target Milestone: ---
Assignee: QA Team
QA Contact:
URL:
Whiteboard: MGA9-64-OK, IN_ERRATA9
Keywords: advisory, validated_update
Depends on:
Blocks:
 
Reported: 2023-11-15 10:16 CET by david Cossé
Modified: 2024-01-06 20:18 CET (History)
8 users (show)

See Also:
Source RPM: fontconfig-2.14.2-1.mga9.src.rpm
CVE:
Status comment:


Attachments
Firefox rendering (34.37 KB, image/png)
2023-11-15 10:17 CET, david Cossé
Details
Okular rendering (53.39 KB, image/png)
2023-11-15 10:18 CET, david Cossé
Details
pdf fonts badly on any application in M9 (112.62 KB, application/pdf)
2023-12-07 15:18 CET, Herman Viaene
Details

Description david Cossé 2023-11-15 10:16:07 CET
Description of problem:
Open a PDF into Firefox

changing browser.display.use_document_fonts from 1 to 0 in about:config solve the problem for PDF but add some on HTML
Comment 1 david Cossé 2023-11-15 10:17:28 CET
Created attachment 14154 [details]
Firefox rendering
Comment 2 david Cossé 2023-11-15 10:18:38 CET
Created attachment 14155 [details]
Okular rendering

CC: (none) => saveurlinux

Comment 3 Morgan Leijström 2023-11-15 10:53:01 CET
Already in errata.
https://wiki.mageia.org/en/Mageia_9_Errata#Firefox_ESR

If someone have a good idea what can be done about it please tell :)

Firefox have no dedicated maintainer.

Keywords: (none) => IN_ERRATA9
CC: (none) => fri

Comment 4 Lewis Smith 2023-11-15 20:57:37 CET
I too have seen this problem (which led to me moaning to the French tax site for not offering a document 'download' link, only 'view'). Do we know whether other distros have it, or just us?
Another workaround is:
 Preferences-General-Programs-Portable Document Format (PDF), set to 'Save File', which should ask to save PDFs rather than trying to display them - which is not a browser job.

How this problem arose is a mystery, given that it used to work. Can we hope that a new release of FF will cure it? Or is it something in our PDF libraries?
The current release firefox-115.4.0-1.mga9 is very recent, and the problem existed before it.

No choice but to assign to NicolasS who nurses Firefox.

Assignee: bugsquad => nicolas.salguero

Comment 5 Nicolas Salguero 2023-11-24 11:35:23 CET
Hi,

In my tests, the problem also appears in Cauldron with firefox-beta (I tried with version 118bx, I did not try with a more recent version) and with firefox 115.5.0 from upstream tarball.

Web searches seem to indicate that the issue is with some fontconfig configuration but I did not find a solution.

Best regards,

Nico.

Assignee: nicolas.salguero => pkg-bugs

Comment 6 katnatek 2023-11-24 19:08:20 CET
(In reply to Nicolas Salguero from comment #5)
> Hi,
> 
> In my tests, the problem also appears in Cauldron with firefox-beta (I tried
> with version 118bx, I did not try with a more recent version) and with
> firefox 115.5.0 from upstream tarball.
> 
> Web searches seem to indicate that the issue is with some fontconfig
> configuration but I did not find a solution.
> 
> Best regards,
> 
> Nico.

I don't know if this could help https://wiki.mageia.org/en/Archive:_Mageia_6_Errata#Changes_in_font_hinting_.28fontconfig.29
Comment 7 Herman Viaene 2023-12-07 15:17:14 CET
The problem is not limited to Firefox. Rather to be expected, it also occurs when opening a pdf attachment in Thunderbird.
Often I get around by saving the pdf and open it from the location with okular. But the file I will attach presents the problem as well in okular as atril or whatever I tried.
This problem has cropped up since I installed (clean install) M9 on mu main desktop PC.

CC: (none) => herman.viaene

Comment 8 Herman Viaene 2023-12-07 15:18:20 CET
Created attachment 14202 [details]
pdf fonts badly on any application in M9
Comment 9 Herman Viaene 2023-12-07 15:52:15 CET
To Comment 4: I just tested my file in VirtualBox-Fedora38 and Mint21, problem appears also there.
Comment 10 Deri James 2023-12-15 00:31:38 CET
Remi Verschelde brought this up with Firefox:-

https://bugzilla.mozilla.org/show_bug.cgi?id=1839860

This suggested command (as root):-

cat > /etc/fonts/conf.d/70-no-bitmaps-firefox.conf << "EOF"
<?xml version='1.0'?>
<!DOCTYPE fontconfig SYSTEM 'fonts.dtd'>
<fontconfig>
  <match>
    <test qual="all" name="prgname" target="pattern" compare="eq">
      <string>firefox</string>
    </test>

   <selectfont>
     <rejectfont>
       <pattern>
         <patelt name="scalable"><bool>false</bool></patelt>
       </pattern>
     </rejectfont>
   </selectfont>
  </match>
</fontconfig>
EOF

Fixed the problem for firefox only, for me. The problem only affects pdfs which do not embed the base fonts. I think the above change ensures firefox only will try to use scalable fonts, i.e. ttf, otf, t1, pfb, pfa.

CC: (none) => deri

Comment 11 Deri James 2023-12-15 00:41:01 CET
(In reply to Herman Viaene from comment #7)
> The problem is not limited to Firefox. Rather to be expected, it also occurs
> when opening a pdf attachment in Thunderbird.
> Often I get around by saving the pdf and open it from the location with
> okular. But the file I will attach presents the problem as well in okular as
> atril or whatever I tried.
> This problem has cropped up since I installed (clean install) M9 on mu main
> desktop PC.

This pdf actually has no fonts! I suspect it is a scan of a page printed by firefox, so any pdf viewer will show it badly.
Comment 12 Nicolas Salguero 2023-12-15 10:24:19 CET
Suggested advisory:
========================

The updated packages fix PDF rendering in Firefox and Thunderbird.

References:
https://bugzilla.mozilla.org/show_bug.cgi?id=1839860
========================

Updated packages in core/updates_testing:
========================
fontconfig-2.14.2-1.1.mga9
lib(64)fontconfig1-2.14.2-1.1.mga9
lib(64)fontconfig-devel-2.14.2-1.1.mga9

from SRPM:
fontconfig-2.14.2-1.1.mga9.src.rpm

Status: NEW => ASSIGNED
Source RPM: firefox-115.4.0-1.mga9 => fontconfig-2.14.2-1.mga9.src.rpm
Keywords: IN_ERRATA9 => (none)
CC: (none) => nicolas.salguero
Assignee: pkg-bugs => qa-bugs

Comment 13 Morgan Leijström 2023-12-15 14:49:12 CET
Wonderful :)

mga9-64 OK

I reverted the workaround in Firefox
(https://bugs.mageia.org/show_bug.cgi?id=32207#c10)
and set thunderbird to preview pdf files.

Opened same problematic pdf in both, observed the problem clearly.

Then installed this update, and simply reloaded the views, and problem gone in both FF and TB :)

---

Entered in end of section
https://wiki.mageia.org/en/Mageia_9_Errata#Various_software

Whiteboard: (none) => MGA9-64-OK
Status comment: (none) => update errata when shipped
Keywords: (none) => IN_ERRATA9

Comment 14 Herman Viaene 2023-12-15 16:41:04 CET
To comment 11:
Quote: "so any pdf viewer will show it badly." That is simply not true. 

I have many pdf files which I created by multiple-page scans of xsane and they all display correctly in okular or whatever I care to use, and have no fonts.
The offending file I sent displays correctly in M$ whatever and in iPad.
Beside, this problem has cropped up on me since I switched my main desktop from M8 to M9. Never before.
Comment 15 Marja Van Waes 2023-12-15 17:34:24 CET
Advisory from comment 12 added to SVN. Please remove the "advisory" keyword if it needs to be changed. It also helps when obsolete advisories are tagged as "obsolete"

Keywords: (none) => advisory
CC: (none) => marja11

Comment 16 Morgan Leijström 2023-12-15 18:06:30 CET
Regarding Comment 14 the attackement "pdf fonts badly on any application in M9", the EIKENHOF Factuur, looks to be a scan of a printout, where the printout have this problem?
What program was used for that print?

Summary: firefox PDF rendering is ugly => fontconfig update address i.e rendering of some PDF fonts in Firefox and Thunderbird

Comment 17 Herman Viaene 2023-12-15 18:59:19 CET
@ Comment 16
This document is an invoice in pdf that has been generated by some commercial SW. It came to the adressee by e-mail. This is something that's been going on for years. The adressee is one of my friends that I converted to Mageia years ago (M4 if I remember correctly) and this is the first time he got that document since I upgraded his installation from M8 to M9 on Oct. 26th.
This is the original file from the e-mail, no intermediate printing - scanning involved.
I have another pdf around which has the same problem in Firefox, the doc has fonts and displays correctly in okular. The pdf was generated by MS-Word.
Comment 18 Deri James 2023-12-15 20:10:47 CET
To Comment 17

In the pdf meta-data it says:-

Creator:        Simple Scan 44.0

So we are correct to say that the pdf is a scan of a printed page. It is likely the original email sent to your friend contained a perfectly valid pdf which was then printed by thunderbird, and the printed page was then scanned and this is the pdf you sent. Now we know that thunderbird has the same issue as firefox when it came to displaying/printing pdfs which contain text but without the base fonts embedded, so when the pdf was printed by thunderbird the invoice on the page would look all wrong. When this is then scanned (your pdf which contains a scanned image), you are seeing exactly what the printed page from thunderbird looked like. This is why no pdf viewer will be able to show the page correctly because the image that was scanned was wrong!

One solution. After the new version of fontconfig is pushed to core updates, and your friend updates his Mag 9, assuming he still has the original email with the pdf, he can print it again and then send you a scan of the freshly printed page.
Comment 19 Herman Viaene 2023-12-16 10:34:13 CET
To Comment 18
No, read what I've written: the pdf is the file he received via e-mail. No printing or scanning involved at the receiver side.
I will ask him if he still has a similar mail from some 6 months ago, when this trouble did not show up in M8.
Comment 20 Morgan Leijström 2023-12-16 14:22:46 CET
That Faktuur is definately an image.
It looks the same in Firefox, Okular and in Acrobat Reader 2023.. on MSW7.
You an also see it because the whole image is a bit slanted, and you see shadows of he paper holes and paper edge.

*Whoever* printed it on that paper seem to have had the same or similar issue that *we* have *now fixed*.

Validating

CC: (none) => sysadmin-bugs
Whiteboard: MGA9-64-OK => MGA9-64-OK, IN_ERRATA9
Keywords: IN_ERRATA9 => validated_update

Comment 21 Mageia Robot 2023-12-16 23:15:43 CET
An update for this issue has been pushed to the Mageia Updates repository.

https://advisories.mageia.org/MGAA-2023-0149.html

Status: ASSIGNED => RESOLVED
Resolution: (none) => FIXED

Comment 22 Morgan Leijström 2023-12-17 19:30:29 CET
This update seem to have broken bitmap fonts on Cauldron.
https://ml.mageia.org/l/arcsearch_id/dev/2023-12/3673493ffbce0a220d07225633923fd931d0c0c5.camel

Was the same change applied there?

If so, do we have the same problem in mga9?

I do not know how to test.
Comment 23 Herman Viaene 2023-12-18 09:46:21 CET
The update did not cure the bad display of the pdf file I provided above.

Status: RESOLVED => REOPENED
Resolution: FIXED => (none)

Comment 24 Nicolas Salguero 2023-12-18 10:25:15 CET
(In reply to Morgan Leijström from comment #22)
> This update seem to have broken bitmap fonts on Cauldron.
> https://ml.mageia.org/l/arcsearch_id/dev/2023-12/
> 3673493ffbce0a220d07225633923fd931d0c0c5.camel
> 
> Was the same change applied there?

Yes, it is exactly the same patch.

(In reply to Herman Viaene from comment #23)
> The update did not cure the bad display of the pdf file I provided above.

I think you cannot reopen that bug because the update was already pushed by the robot.  A new bug is needed.

Resolution: (none) => FIXED
Status: REOPENED => RESOLVED

Comment 25 Morgan Leijström 2023-12-18 10:48:36 CET
@Herman: the pdf you provided is shown identically like acroreader 2023 running on MSWindows 7 do. 
 - the content of the pdf is an old *image* showing the now solved problem.

---

I now opened bug for presumably broken bitmaps:
Bug 32636 - Bitmap fonts broken by fontconfig update bug 32525
Comment 26 Herman Viaene 2023-12-18 11:00:12 CET
I don't understand "the content of the pdf is an old *image* showing the now solved problem". To me, the problem is not solved at all.
So, what should I do nown open yet another bug???
Comment 27 Morgan Leijström 2023-12-18 11:08:08 CET
@Herman, that looks to show bad rendering, but it is only an image of it.
There is no font rendering taking place, as it is an image.
That is why neither the fontconfig fix here, nor the workaround for Firefox in comment 0 works, and Okular also displays it the same.

If you open that pdf on another system; Another distro, Microsoft, Apple, some smart phone... you will see it displays like it do here on Mageia.
Comment 28 Herman Viaene 2023-12-18 12:46:02 CET
@Morgan
As I wrote in Comment 14, the offending pdf displays correctly on my friend's iPad.
But to make a bigger mess of this: after applying the update, on my desktop, the display of the pdf is changed a little but far from good, while an older instance of such invoice displays OK. But on my friends laptop, he cannot reproduce the problem anymore with any pdf that was badly displayed before this update.
So, if he's happy, I don't see any point in keeping this discussion going on. Tx all for your effort.
Comment 29 Morgan Leijström 2023-12-19 16:16:00 CET
Updated errata.

Status comment: update errata when shipped => (none)

Comment 30 Christian Müller 2024-01-06 17:40:47 CET
After applying the update, some fonts (terminus, terminal DEC) are no longer available in konsole, see https://bugs.mageia.org/show_bug.cgi?id=32636.

CC: (none) => chmos

Comment 31 Deri James 2024-01-06 20:18:25 CET
If you want to use terminus fonts in konsole, one solution is to use the OpenType bitmap (.otb) versions of the font from the Terminus website:-

https://terminus-font.sourceforge.net/

or available in the fedora package terminus-fonts-4.49.1-23.fc39.

Note You need to log in before you can comment on or make changes to this bug.