summaryrefslogtreecommitdiffstats
path: root/src/3rdparty/harfbuzz-ng/src
diff options
context:
space:
mode:
Diffstat (limited to 'src/3rdparty/harfbuzz-ng/src')
-rw-r--r--src/3rdparty/harfbuzz-ng/src/hb-coretext.h2
-rw-r--r--src/3rdparty/harfbuzz-ng/src/hb-coretext.mm (renamed from src/3rdparty/harfbuzz-ng/src/hb-coretext.cc)19
2 files changed, 18 insertions, 3 deletions
diff --git a/src/3rdparty/harfbuzz-ng/src/hb-coretext.h b/src/3rdparty/harfbuzz-ng/src/hb-coretext.h
index 4b0a6f01b6..12f7d2515b 100644
--- a/src/3rdparty/harfbuzz-ng/src/hb-coretext.h
+++ b/src/3rdparty/harfbuzz-ng/src/hb-coretext.h
@@ -43,7 +43,7 @@ HB_BEGIN_DECLS
#define HB_CORETEXT_TAG_MORT HB_TAG('m','o','r','t')
#define HB_CORETEXT_TAG_MORX HB_TAG('m','o','r','x')
#define HB_CORETEXT_TAG_KERX HB_TAG('k','e','r','x')
-
+#define HB_CORETEXT_TAG_TRAK HB_TAG('t','r','a','k')
HB_EXTERN hb_face_t *
hb_coretext_face_create (CGFontRef cg_font);
diff --git a/src/3rdparty/harfbuzz-ng/src/hb-coretext.cc b/src/3rdparty/harfbuzz-ng/src/hb-coretext.mm
index d64cb7edbd..185f73cd68 100644
--- a/src/3rdparty/harfbuzz-ng/src/hb-coretext.cc
+++ b/src/3rdparty/harfbuzz-ng/src/hb-coretext.mm
@@ -35,6 +35,7 @@
#include "hb-coretext.h"
#include <math.h>
+#include <Foundation/Foundation.h>
typedef bool (*qt_get_font_table_func_t) (void *user_data, unsigned int tag, unsigned char *buffer, unsigned int *length);
@@ -1322,9 +1323,23 @@ struct hb_coretext_aat_shaper_face_data_t {};
hb_coretext_aat_shaper_face_data_t *
_hb_coretext_aat_shaper_face_data_create (hb_face_t *face)
{
- static const hb_tag_t tags[] = {HB_CORETEXT_TAG_MORX, HB_CORETEXT_TAG_MORT, HB_CORETEXT_TAG_KERX};
+ static const hb_tag_t tags[] = {HB_CORETEXT_TAG_MORX, HB_CORETEXT_TAG_MORT, HB_CORETEXT_TAG_KERX, HB_CORETEXT_TAG_TRAK};
+
+ // Disable macOS 11 / iOS 14 specific hotfix for Qt on older versions, since it caused a
+ // regression. (Note: This code should not been upstreamed and is only applicable to Qt 5.15.x).
+ NSInteger majorVersion = NSProcessInfo.processInfo.operatingSystemVersion.majorVersion;
+ NSInteger hotfixMinimumVersion;
+#if defined(TARGET_OS_IPHONE) && TARGET_OS_IPHONE
+ hotfixMinimumVersion = 14;
+#else
+ hotfixMinimumVersion = 11;
+#endif
+
+ unsigned int arrayLength = ARRAY_LENGTH (tags);
+ if (majorVersion < hotfixMinimumVersion)
+ arrayLength--;
- for (unsigned int i = 0; i < ARRAY_LENGTH (tags); i++)
+ for (unsigned int i = 0; i < arrayLength; i++)
{
hb_blob_t *blob = face->reference_table (tags[i]);
if (hb_blob_get_length (blob))