summaryrefslogtreecommitdiff
path: root/src/base/ftmm.c
diff options
context:
space:
mode:
authorWerner Lemberg <wl@gnu.org>2017-08-05 18:22:17 +0200
committerWerner Lemberg <wl@gnu.org>2017-08-05 18:22:17 +0200
commitf43b3094ef9eec177caafdbc4e73a14be000d127 (patch)
treeca6bb49be97ff57345f6e07b1a692c051fc1ba19 /src/base/ftmm.c
parent24e256ab005c68a3894845ef3b7764338f9442a4 (diff)
downloadfreetype2-f43b3094ef9eec177caafdbc4e73a14be000d127.tar.gz
[base, truetype] New function `FT_Get_Var_Axis_Flags'.
The reserved `flags' field got a value in OpenType version 1.8.2; unfortunately, the public `FT_Var_Axis' structure misses the corresponding element. Since we can't add a new field, we add an access function. * src/base/ftmm.c (FT_Get_Var_Axis_Flags): New function. * include/freetype/ftmm.h (FT_VAR_AXIS_FLAG_HIDDEN): New macro. Updated. * src/truetype/ttgxvar.c (TT_Get_MM_Var): Increase allocated memory of `mmvar' to hold axis flags. Fill the axis flags array. * docs/CHANGES: Updated.
Diffstat (limited to 'src/base/ftmm.c')
-rw-r--r--src/base/ftmm.c24
1 files changed, 24 insertions, 0 deletions
diff --git a/src/base/ftmm.c b/src/base/ftmm.c
index 2cb56a39b..c8450087b 100644
--- a/src/base/ftmm.c
+++ b/src/base/ftmm.c
@@ -402,4 +402,28 @@
}
+ /* documentation is in ftmm.h */
+
+ FT_EXPORT_DEF( FT_Error )
+ FT_Get_Var_Axis_Flags( FT_MM_Var* master,
+ FT_UInt axis_index,
+ FT_UInt* flags )
+ {
+ FT_UShort* axis_flags;
+
+
+ if ( !master || !flags )
+ return FT_THROW( Invalid_Argument );
+
+ if ( axis_index >= master->num_axis )
+ return FT_THROW( Invalid_Argument );
+
+ /* the axis flags array immediately follows the data of `master' */
+ axis_flags = (FT_UShort*)&( master[1] );
+ *flags = axis_flags[axis_index];
+
+ return FT_Err_Ok;
+ }
+
+
/* END */