aboutsummaryrefslogtreecommitdiff
path: root/depends/patches/qt/freetype_back_compat.patch
blob: b0f1c98aa60c9d3442d7c596cd0fd39892a68176 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
commit 14bc77db61bf9d56f9b6c8b84aa02573605c19c6
Author: fanquake <fanquake@gmail.com>
Date:   Tue Aug 18 15:15:08 2020 +0800

    Fix backwards compatibility with older Freetype versions at runtime

    A few years ago, libfreetype introduced FT_Get_Font_Format() as an alias
    for FT_Get_X11_Font_Format(), but FT_Get_X11_Font_Format() was kept for abi
    backwards-compatibility.

    Qt 5.9 introduced a call to FT_Get_Font_Format(). Replace it with FT_Get_X11_Font_Format()
    in order to remain compatibile with older freetype, which is still used by e.g. Ubuntu Trusty.

    See #14348.

diff --git a/qtbase/src/platformsupport/fontdatabases/freetype/qfontengine_ft.cpp b/qtbase/src/platformsupport/fontdatabases/freetype/qfontengine_ft.cpp
index 3f543755..8ecc1c8c 100644
--- a/qtbase/src/platformsupport/fontdatabases/freetype/qfontengine_ft.cpp
+++ b/qtbase/src/platformsupport/fontdatabases/freetype/qfontengine_ft.cpp
@@ -898,7 +898,7 @@ bool QFontEngineFT::init(FaceId faceId, bool antialias, GlyphFormat format,
         }
     }
 #if defined(FT_FONT_FORMATS_H)
-    const char *fmt = FT_Get_Font_Format(face);
+    const char *fmt = FT_Get_X11_Font_Format(face);
     if (fmt && qstrncmp(fmt, "CFF", 4) == 0) {
         FT_Bool no_stem_darkening = true;
         FT_Error err = FT_Property_Get(qt_getFreetype(), "cff", "no-stem-darkening", &no_stem_darkening);