Add `FT_Get_Var_Design_Coordinates' function. Note that the low-level functions aren't implemented yet. * include/freetype/ftmm.h: Declare. * include/freetype/internal/services/svmm.h (FT_Get_Var_Design_Func): New typedef. (MultiMasters): New MM service function `get_var_design'. (FT_DEFINE_SERVICE_MULTIMASTERSREC): Updated. Update all callers. * src/base/ftmm.c (FT_Get_Var_Design_Coordinates): Implement. * src/truetype/ttdriver.c: Updated. * src/truetype/ttgxvar.c (TT_Get_Var_Design): New dummy function to handle `get_var_design' service. * src/truetype/ttgxvar.h: Updated. * src/type1/t1driver.c: Updated. * src/type1/t1load.c (T1_Get_Var_Design): New dummp function to handle `get_var_design' service. * src/type1/t1load.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 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356
diff --git a/ChangeLog b/ChangeLog
index d54467a..70268d2 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,31 @@
+2016-12-06 Dave Arnold <darnold@adobe.com>
+
+ Add `FT_Get_Var_Design_Coordinates' function.
+
+ Note that the low-level functions aren't implemented yet.
+
+ * include/freetype/ftmm.h: Declare.
+
+ * include/freetype/internal/services/svmm.h
+ (FT_Get_Var_Design_Func): New typedef.
+ (MultiMasters): New MM service function `get_var_design'.
+ (FT_DEFINE_SERVICE_MULTIMASTERSREC): Updated.
+ Update all callers.
+
+ * src/base/ftmm.c (FT_Get_Var_Design_Coordinates): Implement.
+
+ * src/truetype/ttdriver.c: Updated.
+
+ * src/truetype/ttgxvar.c (TT_Get_Var_Design): New dummy function to
+ handle `get_var_design' service.
+ * src/truetype/ttgxvar.h: Updated.
+
+ * src/type1/t1driver.c: Updated.
+
+ * src/type1/t1load.c (T1_Get_Var_Design): New dummp function to
+ handle `get_var_design' service.
+ * src/type1/t1load.h: Updated.
+
2016-12-06 Werner Lemberg <wl@gnu.org>
* src/type1/t1load.c (parse_subrs): Fix memory leak.
diff --git a/include/freetype/ftmm.h b/include/freetype/ftmm.h
index c05d3b6..882bdbb 100644
--- a/include/freetype/ftmm.h
+++ b/include/freetype/ftmm.h
@@ -337,6 +337,34 @@ FT_BEGIN_HEADER
/*************************************************************************/
/* */
/* <Function> */
+ /* FT_Get_Var_Design_Coordinates */
+ /* */
+ /* <Description> */
+ /* For Multiple Master and GX Var fonts, get the design coordinates */
+ /* of the currently selected interpolated font. */
+ /* */
+ /* <Input> */
+ /* face :: A handle to the source face. */
+ /* */
+ /* num_coords :: The number of design coordinates to retrieve. If it */
+ /* is larger than the number of axes, set the excess */
+ /* values to~0. */
+ /* */
+ /* <Output> */
+ /* coords :: The design coordinates array. */
+ /* */
+ /* <Return> */
+ /* FreeType error code. 0~means success. */
+ /* */
+ FT_EXPORT( FT_Error )
+ FT_Get_Var_Design_Coordinates( FT_Face face,
+ FT_UInt num_coords,
+ FT_Fixed* coords );
+
+
+ /*************************************************************************/
+ /* */
+ /* <Function> */
/* FT_Set_MM_Blend_Coordinates */
/* */
/* <Description> */
@@ -374,16 +402,16 @@ FT_BEGIN_HEADER
/* For Multiple Masters and GX var fonts, get the normalized blend */
/* coordinates of the currently selected interpolated font. */
/* */
- /* <InOut> */
+ /* <Input> */
/* face :: A handle to the source face. */
/* */
- /* <Input> */
- /* num_coords :: The number of design coordinates to retrieve. If it */
- /* is larger than the number of axes, set the excess */
- /* values to 0.5 for MM fonts, and to 0 for GX var */
- /* fonts. */
+ /* num_coords :: The number of normalized blend coordinates to */
+ /* retrieve. If it is larger than the number of axes, */
+ /* set the excess values to~0.5 for MM fonts, and to~0 */
+ /* for GX var fonts. */
/* */
- /* coords :: The design coordinates array. */
+ /* <Output> */
+ /* coords :: The normalized blend coordinates array. */
/* */
/* <Return> */
/* FreeType error code. 0~means success. */
diff --git a/include/freetype/internal/services/svmm.h b/include/freetype/internal/services/svmm.h
index 8092358..e4d34ba 100644
--- a/include/freetype/internal/services/svmm.h
+++ b/include/freetype/internal/services/svmm.h
@@ -59,6 +59,11 @@ FT_BEGIN_HEADER
FT_Long* coords );
typedef FT_Error
+ (*FT_Get_Var_Design_Func)( FT_Face face,
+ FT_UInt num_coords,
+ FT_Fixed* coords );
+
+ typedef FT_Error
(*FT_Get_MM_Blend_Func)( FT_Face face,
FT_UInt num_coords,
FT_Long* coords );
@@ -72,6 +77,7 @@ FT_BEGIN_HEADER
FT_Get_MM_Blend_Func get_mm_blend;
FT_Get_MM_Var_Func get_mm_var;
FT_Set_Var_Design_Func set_var_design;
+ FT_Get_Var_Design_Func get_var_design;
};
@@ -83,7 +89,8 @@ FT_BEGIN_HEADER
set_mm_blend_, \
get_mm_blend_, \
get_mm_var_, \
- set_var_design_ ) \
+ set_var_design_, \
+ get_var_design_ ) \
static const FT_Service_MultiMastersRec class_ = \
{ \
get_mm_, \
@@ -91,7 +98,8 @@ FT_BEGIN_HEADER
set_mm_blend_, \
get_mm_blend_, \
get_mm_var_, \
- set_var_design_ \
+ set_var_design_, \
+ get_var_design_ \
};
#else /* FT_CONFIG_OPTION_PIC */
@@ -102,7 +110,8 @@ FT_BEGIN_HEADER
set_mm_blend_, \
get_mm_blend_, \
get_mm_var_, \
- set_var_design_ ) \
+ set_var_design_, \
+ get_var_design_ ) \
void \
FT_Init_Class_ ## class_( FT_Service_MultiMastersRec* clazz ) \
{ \
@@ -112,6 +121,7 @@ FT_BEGIN_HEADER
clazz->get_mm_blend = get_mm_blend_; \
clazz->get_mm_var = get_mm_var_; \
clazz->set_var_design = set_var_design_; \
+ clazz->get_var_design = get_var_design_; \
}
#endif /* FT_CONFIG_OPTION_PIC */
diff --git a/src/base/ftmm.c b/src/base/ftmm.c
index 138515e..c352803 100644
--- a/src/base/ftmm.c
+++ b/src/base/ftmm.c
@@ -175,6 +175,34 @@
/* documentation is in ftmm.h */
FT_EXPORT_DEF( FT_Error )
+ FT_Get_Var_Design_Coordinates( FT_Face face,
+ FT_UInt num_coords,
+ FT_Fixed* coords )
+ {
+ FT_Error error;
+ FT_Service_MultiMasters service;
+
+
+ /* check of `face' delayed to `ft_face_get_mm_service' */
+
+ if ( !coords )
+ return FT_THROW( Invalid_Argument );
+
+ error = ft_face_get_mm_service( face, &service );
+ if ( !error )
+ {
+ error = FT_ERR( Invalid_Argument );
+ if ( service->get_var_design )
+ error = service->get_var_design( face, num_coords, coords );
+ }
+
+ return error;
+ }
+
+
+ /* documentation is in ftmm.h */
+
+ FT_EXPORT_DEF( FT_Error )
FT_Set_MM_Blend_Coordinates( FT_Face face,
FT_UInt num_coords,
FT_Fixed* coords )
@@ -193,7 +221,7 @@
{
error = FT_ERR( Invalid_Argument );
if ( service->set_mm_blend )
- error = service->set_mm_blend( face, num_coords, coords );
+ error = service->set_mm_blend( face, num_coords, coords );
}
return error;
@@ -224,7 +252,7 @@
{
error = FT_ERR( Invalid_Argument );
if ( service->set_mm_blend )
- error = service->set_mm_blend( face, num_coords, coords );
+ error = service->set_mm_blend( face, num_coords, coords );
}
return error;
@@ -252,7 +280,7 @@
{
error = FT_ERR( Invalid_Argument );
if ( service->get_mm_blend )
- error = service->get_mm_blend( face, num_coords, coords );
+ error = service->get_mm_blend( face, num_coords, coords );
}
return error;
@@ -283,7 +311,7 @@
{
error = FT_ERR( Invalid_Argument );
if ( service->get_mm_blend )
- error = service->get_mm_blend( face, num_coords, coords );
+ error = service->get_mm_blend( face, num_coords, coords );
}
return error;
diff --git a/src/truetype/ttdriver.c b/src/truetype/ttdriver.c
index 1c4b617..886f7a0 100644
--- a/src/truetype/ttdriver.c
+++ b/src/truetype/ttdriver.c
@@ -472,7 +472,8 @@
(FT_Set_MM_Blend_Func) TT_Set_MM_Blend, /* set_mm_blend */
(FT_Get_MM_Blend_Func) TT_Get_MM_Blend, /* get_mm_blend */
(FT_Get_MM_Var_Func) TT_Get_MM_Var, /* get_mm_var */
- (FT_Set_Var_Design_Func)TT_Set_Var_Design /* set_var_design */
+ (FT_Set_Var_Design_Func)TT_Set_Var_Design, /* set_var_design */
+ (FT_Get_Var_Design_Func)TT_Get_Var_Design /* get_var_design */
)
#endif
diff --git a/src/truetype/ttgxvar.c b/src/truetype/ttgxvar.c
index 0b48c2c..461369f 100644
--- a/src/truetype/ttgxvar.c
+++ b/src/truetype/ttgxvar.c
@@ -1381,6 +1381,20 @@
}
+ FT_LOCAL_DEF( FT_Error )
+ TT_Get_Var_Design( TT_Face face,
+ FT_UInt num_coords,
+ FT_Fixed* coords )
+ {
+ FT_UNUSED( face );
+ FT_UNUSED( num_coords );
+ FT_UNUSED( coords );
+
+ /* TODO: Implement this function. */
+ return FT_THROW( Unimplemented_Feature );
+ }
+
+
/*************************************************************************/
/*************************************************************************/
/***** *****/
diff --git a/src/truetype/ttgxvar.h b/src/truetype/ttgxvar.h
index 408de71..dd13bd8 100644
--- a/src/truetype/ttgxvar.h
+++ b/src/truetype/ttgxvar.h
@@ -162,6 +162,10 @@ FT_BEGIN_HEADER
TT_Get_MM_Var( TT_Face face,
FT_MM_Var* *master );
+ FT_LOCAL( FT_Error )
+ TT_Get_Var_Design( TT_Face face,
+ FT_UInt num_coords,
+ FT_Fixed* coords );
FT_LOCAL( FT_Error )
tt_face_vary_cvt( TT_Face face,
diff --git a/src/type1/t1driver.c b/src/type1/t1driver.c
index e5fb701..639d7c0 100644
--- a/src/type1/t1driver.c
+++ b/src/type1/t1driver.c
@@ -124,7 +124,8 @@
(FT_Set_MM_Blend_Func) T1_Set_MM_Blend, /* set_mm_blend */
(FT_Get_MM_Blend_Func) T1_Get_MM_Blend, /* get_mm_blend */
(FT_Get_MM_Var_Func) T1_Get_MM_Var, /* get_mm_var */
- (FT_Set_Var_Design_Func)T1_Set_Var_Design /* set_var_design */
+ (FT_Set_Var_Design_Func)T1_Set_Var_Design, /* set_var_design */
+ (FT_Get_Var_Design_Func)T1_Get_Var_Design /* get_var_design */
};
#endif
diff --git a/src/type1/t1load.c b/src/type1/t1load.c
index 396f8a5..2b64f85 100644
--- a/src/type1/t1load.c
+++ b/src/type1/t1load.c
@@ -546,6 +546,20 @@
}
+ FT_LOCAL_DEF( FT_Error )
+ T1_Get_Var_Design( T1_Face face,
+ FT_UInt num_coords,
+ FT_Fixed* coords )
+ {
+ FT_UNUSED( face );
+ FT_UNUSED( num_coords );
+ FT_UNUSED( coords );
+
+ /* TODO: Implement this function. */
+ return FT_THROW( Unimplemented_Feature );
+ }
+
+
FT_LOCAL_DEF( void )
T1_Done_Blend( T1_Face face )
{
diff --git a/src/type1/t1load.h b/src/type1/t1load.h
index 1fbd0b4..72445c5 100644
--- a/src/type1/t1load.h
+++ b/src/type1/t1load.h
@@ -70,7 +70,7 @@ FT_BEGIN_HEADER
T1_Get_Multi_Master( T1_Face face,
FT_Multi_Master* master );
- FT_LOCAL_DEF( FT_Error )
+ FT_LOCAL( FT_Error )
T1_Get_MM_Var( T1_Face face,
FT_MM_Var* *master );
@@ -89,7 +89,12 @@ FT_BEGIN_HEADER
FT_UInt num_coords,
FT_Long* coords );
- FT_LOCAL_DEF( FT_Error )
+ FT_LOCAL( FT_Error )
+ T1_Get_Var_Design( T1_Face face,
+ FT_UInt num_coords,
+ FT_Fixed* coords );
+
+ FT_LOCAL( FT_Error )
T1_Set_Var_Design( T1_Face face,
FT_UInt num_coords,
FT_Fixed* coords );