summaryrefslogtreecommitdiffstats
path: root/src/3rdparty/freetype/src/sfnt/ttmtx.c
diff options
context:
space:
mode:
authorEskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>2018-12-10 14:59:49 +0100
committerEskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>2019-01-31 10:40:41 +0000
commit02280535bea08395871722f733aaaed70c992260 (patch)
tree8ff7fd6a26710645d18887fad6299ae7debfded1 /src/3rdparty/freetype/src/sfnt/ttmtx.c
parent93a803a6de27d9eb57931c431b5f3d074914f693 (diff)
Update bundled Freetype to 2.9.1
This is required to support the new emoji font on Android 9. [ChangeLog][Freetype] Upgraded bundled Freetype version to 2.9.1. This also adds support for the latest emoji font in use on Android 9. Fixes: QTBUG-70657 Change-Id: I99be72f0d23c20aca122b8fdadd4ded87b2edce1 Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com>
Diffstat (limited to 'src/3rdparty/freetype/src/sfnt/ttmtx.c')
-rw-r--r--src/3rdparty/freetype/src/sfnt/ttmtx.c48
1 files changed, 47 insertions, 1 deletions
diff --git a/src/3rdparty/freetype/src/sfnt/ttmtx.c b/src/3rdparty/freetype/src/sfnt/ttmtx.c
index 58309aa496..6ddda95b56 100644
--- a/src/3rdparty/freetype/src/sfnt/ttmtx.c
+++ b/src/3rdparty/freetype/src/sfnt/ttmtx.c
@@ -4,7 +4,7 @@
/* */
/* Load the metrics tables common to TTF and OTF fonts (body). */
/* */
-/* Copyright 2006-2015 by */
+/* Copyright 2006-2018 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
@@ -20,11 +20,24 @@
#include FT_INTERNAL_DEBUG_H
#include FT_INTERNAL_STREAM_H
#include FT_TRUETYPE_TAGS_H
+
+#ifdef TT_CONFIG_OPTION_GX_VAR_SUPPORT
+#include FT_SERVICE_METRICS_VARIATIONS_H
+#endif
+
#include "ttmtx.h"
#include "sferrors.h"
+ /* IMPORTANT: The TT_HoriHeader and TT_VertHeader structures should */
+ /* be identical except for the names of their fields, */
+ /* which are different. */
+ /* */
+ /* This ensures that `tt_face_load_hmtx' is able to read */
+ /* both the horizontal and vertical headers. */
+
+
/*************************************************************************/
/* */
/* The macro FT_COMPONENT is used in trace mode. It is an implicit */
@@ -214,6 +227,11 @@
FT_ULong table_pos, table_size, table_end;
FT_UShort k;
+#ifdef TT_CONFIG_OPTION_GX_VAR_SUPPORT
+ FT_Service_MetricsVariations var =
+ (FT_Service_MetricsVariations)face->var;
+#endif
+
if ( vertical )
{
@@ -274,6 +292,34 @@
*abearing = 0;
*aadvance = 0;
}
+
+#ifdef TT_CONFIG_OPTION_GX_VAR_SUPPORT
+ if ( var )
+ {
+ FT_Face f = FT_FACE( face );
+ FT_Int a = (FT_Int)*aadvance;
+ FT_Int b = (FT_Int)*abearing;
+
+
+ if ( vertical )
+ {
+ if ( var->vadvance_adjust )
+ var->vadvance_adjust( f, gindex, &a );
+ if ( var->tsb_adjust )
+ var->tsb_adjust( f, gindex, &b );
+ }
+ else
+ {
+ if ( var->hadvance_adjust )
+ var->hadvance_adjust( f, gindex, &a );
+ if ( var->lsb_adjust )
+ var->lsb_adjust( f, gindex, &b );
+ }
+
+ *aadvance = (FT_UShort)a;
+ *abearing = (FT_Short)b;
+ }
+#endif
}