[truetype, cff] Extend `get_var_blend' function of MM service. In particular, we need access to named instance data. * include/freetype/internal/services/svmm.h (FT_Get_Var_Blend_Func): Add argument for `FT_MM_Var'. * src/cff/cffload.c (cff_get_var_blend): Updated. * src/cff/cffload.h: Updated. * src/cff/cf2ft.c (cf2_getNormalizedVector): Updated. * src/truetype/ttgxvar.c (tt_get_var_blend): Updated. Accept value `NULL' for arguments. * src/truetype/ttgxvar.h: Updated.
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 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165
diff --git a/ChangeLog b/ChangeLog
index 75a33bd..46623ad 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,23 @@
2016-12-18 Werner Lemberg <wl@gnu.org>
+ [truetype, cff] Extend `get_var_blend' function of MM service.
+
+ In particular, we need access to named instance data.
+
+ * include/freetype/internal/services/svmm.h (FT_Get_Var_Blend_Func):
+ Add argument for `FT_MM_Var'.
+
+ * src/cff/cffload.c (cff_get_var_blend): Updated.
+ * src/cff/cffload.h: Updated.
+
+ * src/cff/cf2ft.c (cf2_getNormalizedVector): Updated.
+
+ * src/truetype/ttgxvar.c (tt_get_var_blend): Updated.
+ Accept value `NULL' for arguments.
+ * src/truetype/ttgxvar.h: Updated.
+
+2016-12-18 Werner Lemberg <wl@gnu.org>
+
[sfnt] Handle `fvar' with zero axes as a non-MM font.
This is better behaviour than exiting with an error.
diff --git a/include/freetype/internal/services/svmm.h b/include/freetype/internal/services/svmm.h
index 21dbd87..e54845a 100644
--- a/include/freetype/internal/services/svmm.h
+++ b/include/freetype/internal/services/svmm.h
@@ -69,9 +69,10 @@ FT_BEGIN_HEADER
FT_Long* coords );
typedef FT_Error
- (*FT_Get_Var_Blend_Func)( FT_Face face,
- FT_UInt *num_coords,
- FT_Fixed* *coords );
+ (*FT_Get_Var_Blend_Func)( FT_Face face,
+ FT_UInt *num_coords,
+ FT_Fixed* *coords,
+ FT_MM_Var* *mm_var );
typedef void
(*FT_Done_Blend_Func)( FT_Face );
diff --git a/src/cff/cf2ft.c b/src/cff/cf2ft.c
index 02f16ab..a7fb5aa 100644
--- a/src/cff/cf2ft.c
+++ b/src/cff/cf2ft.c
@@ -450,7 +450,7 @@
FT_ASSERT( decoder && decoder->builder.face );
FT_ASSERT( vec && len );
- return cff_get_var_blend( decoder->builder.face, len, vec );
+ return cff_get_var_blend( decoder->builder.face, len, vec, NULL );
}
#endif
diff --git a/src/cff/cffload.c b/src/cff/cffload.c
index d347b0a..c097523 100644
--- a/src/cff/cffload.c
+++ b/src/cff/cffload.c
@@ -1548,14 +1548,15 @@
#ifdef TT_CONFIG_OPTION_GX_VAR_SUPPORT
FT_LOCAL_DEF( FT_Error )
- cff_get_var_blend( CFF_Face face,
- FT_UInt *num_coords,
- FT_Fixed* *coords )
+ cff_get_var_blend( CFF_Face face,
+ FT_UInt *num_coords,
+ FT_Fixed* *coords,
+ FT_MM_Var* *mm_var )
{
FT_Service_MultiMasters mm = (FT_Service_MultiMasters)face->mm;
- return mm->get_var_blend( FT_FACE( face ), num_coords, coords );
+ return mm->get_var_blend( FT_FACE( face ), num_coords, coords, mm_var );
}
diff --git a/src/cff/cffload.h b/src/cff/cffload.h
index 2da726c..dc3a2c5 100644
--- a/src/cff/cffload.h
+++ b/src/cff/cffload.h
@@ -105,9 +105,10 @@ FT_BEGIN_HEADER
#ifdef TT_CONFIG_OPTION_GX_VAR_SUPPORT
FT_LOCAL( FT_Error )
- cff_get_var_blend( CFF_Face face,
- FT_UInt *num_coords,
- FT_Fixed* *coords );
+ cff_get_var_blend( CFF_Face face,
+ FT_UInt *num_coords,
+ FT_Fixed* *coords,
+ FT_MM_Var* *mm_var );
FT_LOCAL( void )
cff_done_blend( CFF_Face face );
diff --git a/src/truetype/ttgxvar.c b/src/truetype/ttgxvar.c
index 3bcec27..5a4e8f5 100644
--- a/src/truetype/ttgxvar.c
+++ b/src/truetype/ttgxvar.c
@@ -2740,24 +2740,33 @@
/* tt_get_var_blend */
/* */
/* <Description> */
- /* An internal version of `TT_Get_MM_Blend' that just returns */
+ /* An extended internal version of `TT_Get_MM_Blend' that returns */
/* pointers instead of copying data, without any initialization of */
/* the MM machinery in case it isn't loaded yet. */
/* */
FT_LOCAL_DEF( FT_Error )
- tt_get_var_blend( TT_Face face,
- FT_UInt *num_coords,
- FT_Fixed* *coords )
+ tt_get_var_blend( TT_Face face,
+ FT_UInt *num_coords,
+ FT_Fixed* *coords,
+ FT_MM_Var* *mm_var )
{
if ( face->blend )
{
- *num_coords = face->blend->num_axis;
- *coords = face->blend->normalizedcoords;
+ if ( num_coords )
+ *num_coords = face->blend->num_axis;
+ if ( coords )
+ *coords = face->blend->normalizedcoords;
+ if ( mm_var )
+ *mm_var = face->blend->mmvar;
}
else
{
- *num_coords = 0;
- *coords = NULL;
+ if ( num_coords )
+ *num_coords = 0;
+ if ( coords )
+ *coords = NULL;
+ if ( mm_var )
+ *mm_var = NULL;
}
return FT_Err_Ok;
diff --git a/src/truetype/ttgxvar.h b/src/truetype/ttgxvar.h
index 95f991f..215e109 100644
--- a/src/truetype/ttgxvar.h
+++ b/src/truetype/ttgxvar.h
@@ -260,9 +260,10 @@ FT_BEGIN_HEADER
FT_Int *adelta );
FT_LOCAL( FT_Error )
- tt_get_var_blend( TT_Face face,
- FT_UInt *num_coords,
- FT_Fixed* *coords );
+ tt_get_var_blend( TT_Face face,
+ FT_UInt *num_coords,
+ FT_Fixed* *coords,
+ FT_MM_Var* *mm_var );
FT_LOCAL( void )
tt_done_blend( TT_Face face );