Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 16 Apr 2023 21:11:10 GMT
From:      Christoph Moench-Tegeder <cmt@FreeBSD.org>
To:        ports-committers@FreeBSD.org, dev-commits-ports-all@FreeBSD.org, dev-commits-ports-branches@FreeBSD.org
Subject:   git: e8ff22a7cd5b - 2023Q2 - www/firefox: fix fonts becoming transparent in some configurations
Message-ID:  <202304162111.33GLBA1r036550@gitrepo.freebsd.org>

next in thread | raw e-mail | index | archive | help
The branch 2023Q2 has been updated by cmt:

URL: https://cgit.FreeBSD.org/ports/commit/?id=e8ff22a7cd5b92f100de73c466faf769802ff705

commit e8ff22a7cd5b92f100de73c466faf769802ff705
Author:     Christoph Moench-Tegeder <cmt@FreeBSD.org>
AuthorDate: 2023-04-16 21:06:47 +0000
Commit:     Christoph Moench-Tegeder <cmt@FreeBSD.org>
CommitDate: 2023-04-16 21:10:55 +0000

    www/firefox: fix fonts becoming transparent in some configurations
    
    https://bugzilla.mozilla.org/show_bug.cgi?id=1827950
    
    PR:             270695
    (cherry picked from commit 6ffeab7ede9450a397417f4ba6b878a793a47804)
---
 www/firefox/Makefile               |  1 +
 www/firefox/files/patch-bug1827950 | 51 ++++++++++++++++++++++++++++++++++++++
 2 files changed, 52 insertions(+)

diff --git a/www/firefox/Makefile b/www/firefox/Makefile
index 9d2daf8d1b2b..6cd9cd0d5570 100644
--- a/www/firefox/Makefile
+++ b/www/firefox/Makefile
@@ -1,5 +1,6 @@
 PORTNAME=	firefox
 DISTVERSION=	112.0.1
+PORTREVISION=	1
 PORTEPOCH=	2
 CATEGORIES=	www wayland
 MASTER_SITES=	MOZILLA/${PORTNAME}/releases/${DISTVERSION}${DISTVERSIONSUFFIX}/source \
diff --git a/www/firefox/files/patch-bug1827950 b/www/firefox/files/patch-bug1827950
new file mode 100644
index 000000000000..d00147a7380e
--- /dev/null
+++ b/www/firefox/files/patch-bug1827950
@@ -0,0 +1,51 @@
+diff --git gfx/thebes/gfxFont.cpp gfx/thebes/gfxFont.cpp
+--- gfx/thebes/gfxFont.cpp
++++ gfx/thebes/gfxFont.cpp
+@@ -2467,11 +2467,19 @@
+     fontParams.extraStrikes = 0;
+   }
+ 
+   // Figure out the maximum extents for the font, accounting for synthetic
+   // oblique and bold.
+-  fontParams.fontExtents = GetFontEntry()->GetFontExtents(mFUnitsConvFactor);
++  if (mFUnitsConvFactor > 0.0) {
++    fontParams.fontExtents = GetFontEntry()->GetFontExtents(mFUnitsConvFactor);
++  } else {
++    // Was it not an sfnt? Maybe on Linux... use arbitrary huge extents, so we
++    // don't inadvertently clip stuff. A bit less efficient than true extents,
++    // but this should be extremely rare.
++    auto size = GetAdjustedSize();
++    fontParams.fontExtents = Rect(-2 * size, -2 * size, 5 * size, 5 * size);
++  }
+   if (fontParams.obliqueSkew != 0.0f) {
+     gfx::Point p(fontParams.fontExtents.x, fontParams.fontExtents.y);
+     gfx::Matrix skew(1, 0, fontParams.obliqueSkew, 1, 0, 0);
+     fontParams.fontExtents = skew.TransformBounds(fontParams.fontExtents);
+   }
+diff --git gfx/thebes/gfxFontEntry.cpp gfx/thebes/gfxFontEntry.cpp
+--- gfx/thebes/gfxFontEntry.cpp
++++ gfx/thebes/gfxFontEntry.cpp
+@@ -282,15 +282,18 @@
+       uint32_t len;
+       const HeadTable* head =
+           reinterpret_cast<const HeadTable*>(hb_blob_get_data(headTable, &len));
+       if (len >= sizeof(HeadTable)) {
+         mUnitsPerEm = head->unitsPerEm;
++        if (int16_t(head->xMax) > int16_t(head->xMin) &&
++            int16_t(head->yMax) > int16_t(head->yMin)) {
++          mXMin = head->xMin;
++          mYMin = head->yMin;
++          mXMax = head->xMax;
++          mYMax = head->yMax;
++        }
+       }
+-      mXMin = head->xMin;
+-      mYMin = head->yMin;
+-      mXMax = head->xMax;
+-      mYMax = head->yMax;
+     }
+ 
+     // if we didn't find a usable 'head' table, or if the value was
+     // outside the valid range, record it as invalid
+     if (mUnitsPerEm < kMinUPEM || mUnitsPerEm > kMaxUPEM) {
+



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202304162111.33GLBA1r036550>