summaryrefslogtreecommitdiff
path: root/third_party/freetype/src/sfnt/ttmtx.c
diff options
context:
space:
mode:
authorLei Zhang <thestig@chromium.org>2017-03-29 21:02:13 -0700
committerChromium commit bot <commit-bot@chromium.org>2017-03-30 04:15:13 +0000
commit3de5005b3013bc7f9b62bc2153786de90a3cc285 (patch)
tree20a2514fef275a461ae1ac17a14356406f426a63 /third_party/freetype/src/sfnt/ttmtx.c
parent75b11e43c284ff80bf49a3c1a0980353b942ff89 (diff)
downloadpdfium-3de5005b3013bc7f9b62bc2153786de90a3cc285.tar.xz
Upgrade to FreeType 2.7.1.
BUG=pdfium:601 Change-Id: I07756cd208cd2221802ff2d331f316b6618a41e0 Reviewed-on: https://pdfium-review.googlesource.com/3120 Commit-Queue: Lei Zhang <thestig@chromium.org> Reviewed-by: dsinclair <dsinclair@chromium.org>
Diffstat (limited to 'third_party/freetype/src/sfnt/ttmtx.c')
-rw-r--r--third_party/freetype/src/sfnt/ttmtx.c40
1 files changed, 39 insertions, 1 deletions
diff --git a/third_party/freetype/src/sfnt/ttmtx.c b/third_party/freetype/src/sfnt/ttmtx.c
index 58309aa496..f2e5541783 100644
--- a/third_party/freetype/src/sfnt/ttmtx.c
+++ b/third_party/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-2017 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
@@ -20,6 +20,11 @@
#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"
@@ -214,6 +219,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 +284,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
}