[truetype, type1] Add `get_var_blend' to MM service. For internal use; we want to share code between the forthcoming CFF2 support and TrueType. * include/freetype/internal/services/svmm.h (FT_Get_Var_Blend_Func): New typedef. (MultiMasters): Add `get_var_blend'. (FT_Service_MultiMasters): Updated. * src/truetype/ttgxvar.c (tt_get_var_blend): New function. * src/truetype/ttgxvar.h: Updated. * src/truetype/ttdriver.c (tt_service_gx_multi_masters): Updated. * src/type1/t1driver.c (t1_service_multi_masters): 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 166 167 168
diff --git a/ChangeLog b/ChangeLog
index 37478d6..2a5a1bd 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,23 @@
2016-12-10 Werner Lemberg <wl@gnu.org>
+ [truetype, type1] Add `get_var_blend' to MM service.
+
+ For internal use; we want to share code between the forthcoming CFF2
+ support and TrueType.
+
+ * include/freetype/internal/services/svmm.h (FT_Get_Var_Blend_Func):
+ New typedef.
+ (MultiMasters): Add `get_var_blend'.
+ (FT_Service_MultiMasters): Updated.
+
+ * src/truetype/ttgxvar.c (tt_get_var_blend): New function.
+ * src/truetype/ttgxvar.h: Updated.
+
+ * src/truetype/ttdriver.c (tt_service_gx_multi_masters): Updated.
+ * src/type1/t1driver.c (t1_service_multi_masters): Updated.
+
+2016-12-10 Werner Lemberg <wl@gnu.org>
+
[truetype, type1] Add `done_blend' to MM service.
For internal use; we want to share code between the forthcoming CFF2
diff --git a/include/freetype/internal/services/svmm.h b/include/freetype/internal/services/svmm.h
index 51bce40..21dbd87 100644
--- a/include/freetype/internal/services/svmm.h
+++ b/include/freetype/internal/services/svmm.h
@@ -68,6 +68,11 @@ FT_BEGIN_HEADER
FT_UInt num_coords,
FT_Long* coords );
+ typedef FT_Error
+ (*FT_Get_Var_Blend_Func)( FT_Face face,
+ FT_UInt *num_coords,
+ FT_Fixed* *coords );
+
typedef void
(*FT_Done_Blend_Func)( FT_Face );
@@ -83,6 +88,7 @@ FT_BEGIN_HEADER
FT_Get_Var_Design_Func get_var_design;
/* for internal use; only needed for code sharing between modules */
+ FT_Get_Var_Blend_Func get_var_blend;
FT_Done_Blend_Func done_blend;
};
@@ -97,6 +103,7 @@ FT_BEGIN_HEADER
get_mm_var_, \
set_var_design_, \
get_var_design_, \
+ get_var_blend_, \
done_blend_ ) \
static const FT_Service_MultiMastersRec class_ = \
{ \
@@ -107,6 +114,7 @@ FT_BEGIN_HEADER
get_mm_var_, \
set_var_design_, \
get_var_design_, \
+ get_var_blend_, \
done_blend_ \
};
@@ -120,6 +128,7 @@ FT_BEGIN_HEADER
get_mm_var_, \
set_var_design_, \
get_var_design_, \
+ get_var_blend_, \
done_blend_ ) \
void \
FT_Init_Class_ ## class_( FT_Service_MultiMastersRec* clazz ) \
@@ -131,6 +140,7 @@ FT_BEGIN_HEADER
clazz->get_mm_var = get_mm_var_; \
clazz->set_var_design = set_var_design_; \
clazz->get_var_design = get_var_design_; \
+ clazz->get_var_blend = get_var_blend_; \
clazz->done_blend = done_blend_; \
}
diff --git a/src/truetype/ttdriver.c b/src/truetype/ttdriver.c
index b7713d0..6ab8d3f 100644
--- a/src/truetype/ttdriver.c
+++ b/src/truetype/ttdriver.c
@@ -475,6 +475,7 @@
(FT_Set_Var_Design_Func)TT_Set_Var_Design, /* set_var_design */
(FT_Get_Var_Design_Func)TT_Get_Var_Design, /* get_var_design */
+ (FT_Get_Var_Blend_Func) tt_get_var_blend, /* get_var_blend */
(FT_Done_Blend_Func) tt_done_blend /* done_blend */
)
#endif
diff --git a/src/truetype/ttgxvar.c b/src/truetype/ttgxvar.c
index 212358c..06b1200 100644
--- a/src/truetype/ttgxvar.c
+++ b/src/truetype/ttgxvar.c
@@ -2236,6 +2236,39 @@
/*************************************************************************/
/* */
/* <Function> */
+ /* tt_get_var_blend */
+ /* */
+ /* <Description> */
+ /* An internal version of `TT_Get_MM_Blend' that just 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 )
+ {
+ FT_Error error = FT_Err_Ok;
+
+
+ if ( face->blend )
+ {
+ *num_coords = face->blend->num_axis;
+ *coords = face->blend->normalizedcoords;
+ }
+ else
+ {
+ *num_coords = 0;
+ *coords = NULL;
+ }
+
+ return FT_Err_Ok;
+ }
+
+
+ /*************************************************************************/
+ /* */
+ /* <Function> */
/* tt_done_blend */
/* */
/* <Description> */
diff --git a/src/truetype/ttgxvar.h b/src/truetype/ttgxvar.h
index f3fcfc7..9e4d749 100644
--- a/src/truetype/ttgxvar.h
+++ b/src/truetype/ttgxvar.h
@@ -179,6 +179,11 @@ FT_BEGIN_HEADER
FT_UInt n_points );
+ FT_LOCAL( FT_Error )
+ tt_get_var_blend( TT_Face face,
+ FT_UInt *num_coords,
+ FT_Fixed* *coords );
+
FT_LOCAL( void )
tt_done_blend( TT_Face face );
diff --git a/src/type1/t1driver.c b/src/type1/t1driver.c
index ad46371..fd9e13e 100644
--- a/src/type1/t1driver.c
+++ b/src/type1/t1driver.c
@@ -127,6 +127,7 @@
(FT_Set_Var_Design_Func)T1_Set_Var_Design, /* set_var_design */
(FT_Get_Var_Design_Func)T1_Get_Var_Design, /* get_var_design */
+ (FT_Get_Var_Blend_Func) NULL, /* get_var_blend */
(FT_Done_Blend_Func) T1_Done_Blend /* done_blend */
};
#endif