vcl/inc/unx/glyphcache.hxx                     |    6 ----
 vcl/skia/x11/textrender.cxx                    |    3 --
 vcl/unx/generic/gdi/cairotextrender.cxx        |    2 -
 vcl/unx/generic/glyphs/freetype_glyphcache.cxx |   34 -------------------------
 4 files changed, 45 deletions(-)

New commits:
commit ba9c6ad27d76de2cc4bc43cc2836a9680a3e1a9b
Author:     Caolán McNamara <[email protected]>
AuthorDate: Fri Aug 26 14:59:26 2022 +0100
Commit:     Caolán McNamara <[email protected]>
CommitDate: Fri Aug 26 18:11:51 2022 +0200

    freetype 2.9 was relesed in Jan 2018, drop workaround for <= 2.8
    
    Change-Id: Iaf95faa15d56e8f26ed57cb4744b039a18223c5c
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/138877
    Tested-by: Jenkins
    Reviewed-by: Caolán McNamara <[email protected]>

diff --git a/vcl/inc/unx/glyphcache.hxx b/vcl/inc/unx/glyphcache.hxx
index b54e10bdb20b..27ddd6cb32b5 100644
--- a/vcl/inc/unx/glyphcache.hxx
+++ b/vcl/inc/unx/glyphcache.hxx
@@ -134,12 +134,6 @@ public:
 
     void                    SetFontVariationsOnHBFont(hb_font_t* pHbFace) 
const;
 
-    // tdf#127189 FreeType <= 2.8 will fail to render stretched horizontal 
brace glyphs
-    // in starmath at a fairly low stretch ratio. This appears fixed in 2.9 
with
-    // 
https://git.savannah.gnu.org/cgit/freetype/freetype2.git/commit/?id=91015cb41d8f56777f93394f5a60914bc0c0f330
-    // "Improve complex rendering at high ppem"
-    static bool             AlmostHorizontalDrainsRenderingPool(int nRatio, 
const vcl::font::FontSelectPattern& rFSD);
-
 private:
     friend class FreetypeFontInstance;
     friend class FreetypeManager;
diff --git a/vcl/skia/x11/textrender.cxx b/vcl/skia/x11/textrender.cxx
index 3548dc61683e..7be518e96c92 100644
--- a/vcl/skia/x11/textrender.cxx
+++ b/vcl/skia/x11/textrender.cxx
@@ -40,9 +40,6 @@ void SkiaTextRender::DrawTextLayout(const GenericSalLayout& 
rLayout, const SalGr
     if (nWidth == 0 || nHeight == 0)
         return;
 
-    if (FreetypeFont::AlmostHorizontalDrainsRenderingPool(nWidth * 10 / 
nHeight, rFSD))
-        return;
-
     if (!fontManager)
     {
         // Get the global FcConfig that our VCL fontconfig code uses, and 
refcount it.
diff --git a/vcl/unx/generic/gdi/cairotextrender.cxx 
b/vcl/unx/generic/gdi/cairotextrender.cxx
index 006ea2ce8d4a..5ddee651d70e 100644
--- a/vcl/unx/generic/gdi/cairotextrender.cxx
+++ b/vcl/unx/generic/gdi/cairotextrender.cxx
@@ -205,8 +205,6 @@ void CairoTextRender::DrawTextLayout(const 
GenericSalLayout& rLayout, const SalG
     }
 
     int nRatio = nWidth * 10 / nHeight;
-    if (FreetypeFont::AlmostHorizontalDrainsRenderingPool(nRatio, rFSD))
-        return;
 
     /*
      * It might be ideal to cache surface and cairo context between calls and
diff --git a/vcl/unx/generic/glyphs/freetype_glyphcache.cxx 
b/vcl/unx/generic/glyphs/freetype_glyphcache.cxx
index 848405169cd2..c9c471144bd3 100644
--- a/vcl/unx/generic/glyphs/freetype_glyphcache.cxx
+++ b/vcl/unx/generic/glyphs/freetype_glyphcache.cxx
@@ -313,40 +313,6 @@ void FreetypeManager::InitFreetype()
         nDefaultPrioAntiAlias = pEnv[0] - '0';
 }
 
-namespace
-{
-    bool DoesAlmostHorizontalDrainRenderingPool()
-    {
-        FT_Int nMajor, nMinor, nPatch;
-        FT_Library_Version(aLibFT, &nMajor, &nMinor, &nPatch);
-        if (nMajor > 2)
-            return false;
-        if (nMajor == 2 && nMinor <= 8)
-            return true;
-        return false;
-    }
-}
-
-bool FreetypeFont::AlmostHorizontalDrainsRenderingPool(int nRatio, const 
vcl::font::FontSelectPattern& rFSD)
-{
-    static bool bAlmostHorizontalDrainsRenderingPool = 
DoesAlmostHorizontalDrainRenderingPool();
-    if (nRatio > 100 && rFSD.maTargetName == "OpenSymbol" && 
bAlmostHorizontalDrainsRenderingPool)
-    {
-        // tdf#127189 FreeType <= 2.8 will fail to render stretched horizontal
-        // brace glyphs in starmath at a fairly low stretch ratio. The failure
-        // will set CAIRO_STATUS_FREETYPE_ERROR on the surface which cannot be
-        // cleared, so all further painting to the surface fails.
-
-        // This appears fixed in >= freetype 2.9
-
-        // Restrict this bodge to a stretch ratio > ~10 of the OpenSymbol font
-        // where it has been seen in practice.
-        SAL_WARN("vcl", "rendering text would fail with stretch ratio of: " << 
nRatio << ", with FreeType <= 2.8");
-        return true;
-    }
-    return false;
-}
-
 FT_Face FreetypeFont::GetFtFace() const
 {
     FT_Activate_Size( maSizeFT );

Reply via email to