From 7b11f14c05e5c6a413e6ce241866a7e11b8c232e Mon Sep 17 00:00:00 2001 From: Paul Menzel Date: Fri, 28 Jul 2023 15:29:58 +0200 Subject: [PATCH 1/2] etc/fonts/conf.d: Disable bitmap fonts for Firefox (pdf.js) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit [pdf.js commit 53134c0c0bb2 ([api-minor] Use a local font or fallback on an embedded one (if it exists) for non-embedded fonts (bug 1766039))][1] [breaks][3] [font selection in PDF documents][3], when the font is not embedded and bitmap fonts, like X.Org fonts, are available. Work around it by disabling bitmap fonts for Mozilla Firefox. Suggested-by: Calixte Denizet Resolves: https://github.molgen.mpg.de/mariux64/bee-files/issues/2933 Copy commit message from [proposed (and rejected) bee-files commit][4]: > This works around a Mozilla Firefox regression from 114.0 to 115.0. > Firefox was upgraded from 114.0 to 115.0 around July 5th, 2023, and > until now we had two problem reports. It’s actually a [regression][1] > [in][2] [pdf.js][3], used to display PDF files inside the browser. > Evince or other PDF viewers do not have the problem. > > The problem is, that for PDF documents using Helvetica, but not > embedding the font, pdf.js chooses the X.Org font, despite Fontconfig > matching *Helvetica* to *Nimbus Sans L*: > > $ fc-match Helvetica > n019003l.pfb: "Nimbus Sans L" "Regular" > > As downgrading Firefox from 115.0.2 to 114.0 is unsupported by Mozilla > for profiles – a warning is shown, and you need to start it with > `--allow-downgrade` – remove the likely unused Helvetica fonts confusing > Firefox/pdf.js. [1]: https://github.com/mozilla/pdf.js/commit/53134c0c0bb2d19244dd8c31aa4e8e6d01a657e4 [2]: https://bugzilla.mozilla.org/show_bug.cgi?id=1845551 [3]: https://bugzilla.mozilla.org/show_bug.cgi?id=1839860 [4]: https://github.molgen.mpg.de/mariux64/bee-files/pull/2935 --- etc/fonts/conf.d/70-no-bitmaps-firefox.conf | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 etc/fonts/conf.d/70-no-bitmaps-firefox.conf diff --git a/etc/fonts/conf.d/70-no-bitmaps-firefox.conf b/etc/fonts/conf.d/70-no-bitmaps-firefox.conf new file mode 100644 index 0000000..ec6cac1 --- /dev/null +++ b/etc/fonts/conf.d/70-no-bitmaps-firefox.conf @@ -0,0 +1,19 @@ + + + + Disable bitmap fonts for Firefox/pdf.js to work around https://bugzilla.mozilla.org/show_bug.cgi?id=1839860 + + + + firefox + + + + + + false + + + + + From 93d113bd0af74dfc5c28683a90d854b06294bf0e Mon Sep 17 00:00:00 2001 From: Paul Menzel Date: Mon, 31 Jul 2023 11:31:05 +0200 Subject: [PATCH 2/2] etc/fonts/conf.d/70-no-bitmaps-firefox.conf: Replace `description` element by comment Fontconfig 2.12.4 does not know the element `description`, so convert to a comment to avoid the warning below: /etc/fonts/conf.d/70-no-bitmaps-firefox.conf", line 4: unknown element "description" The supported elements are listed in `/usr/share/xml/fontconfig/fonts.dtd`. --- etc/fonts/conf.d/70-no-bitmaps-firefox.conf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/etc/fonts/conf.d/70-no-bitmaps-firefox.conf b/etc/fonts/conf.d/70-no-bitmaps-firefox.conf index ec6cac1..2862ae7 100644 --- a/etc/fonts/conf.d/70-no-bitmaps-firefox.conf +++ b/etc/fonts/conf.d/70-no-bitmaps-firefox.conf @@ -1,7 +1,7 @@ - Disable bitmap fonts for Firefox/pdf.js to work around https://bugzilla.mozilla.org/show_bug.cgi?id=1839860 +