1 /***************************************************************************/
5 /* Multiple Master font support (body). */
7 /* Copyright 1996-2001, 2003, 2004, 2009, 2013 by */
8 /* David Turner, Robert Wilhelm, and Werner Lemberg. */
10 /* This file is part of the FreeType project, and may only be used, */
11 /* modified, and distributed under the terms of the FreeType project */
12 /* license, LICENSE.TXT. By continuing to use, modify, or distribute */
13 /* this file you indicate that you have read the license and */
14 /* understand and accept it fully. */
16 /***************************************************************************/
20 #include FT_INTERNAL_DEBUG_H
22 #include FT_MULTIPLE_MASTERS_H
23 #include FT_INTERNAL_OBJECTS_H
24 #include FT_SERVICE_MULTIPLE_MASTERS_H
27 /*************************************************************************/
29 /* The macro FT_COMPONENT is used in trace mode. It is an implicit */
30 /* parameter of the FT_TRACE() and FT_ERROR() macros, used to print/log */
31 /* messages during execution. */
34 #define FT_COMPONENT trace_mm
38 ft_face_get_mm_service( FT_Face face
,
39 FT_Service_MultiMasters
*aservice
)
47 return FT_THROW( Invalid_Face_Handle
);
49 error
= FT_ERR( Invalid_Argument
);
51 if ( FT_HAS_MULTIPLE_MASTERS( face
) )
53 FT_FACE_LOOKUP_SERVICE( face
,
65 /* documentation is in ftmm.h */
67 FT_EXPORT_DEF( FT_Error
)
68 FT_Get_Multi_Master( FT_Face face
,
69 FT_Multi_Master
*amaster
)
72 FT_Service_MultiMasters service
;
75 error
= ft_face_get_mm_service( face
, &service
);
78 error
= FT_ERR( Invalid_Argument
);
79 if ( service
->get_mm
)
80 error
= service
->get_mm( face
, amaster
);
87 /* documentation is in ftmm.h */
89 FT_EXPORT_DEF( FT_Error
)
90 FT_Get_MM_Var( FT_Face face
,
94 FT_Service_MultiMasters service
;
97 error
= ft_face_get_mm_service( face
, &service
);
100 error
= FT_ERR( Invalid_Argument
);
101 if ( service
->get_mm_var
)
102 error
= service
->get_mm_var( face
, amaster
);
109 /* documentation is in ftmm.h */
111 FT_EXPORT_DEF( FT_Error
)
112 FT_Set_MM_Design_Coordinates( FT_Face face
,
117 FT_Service_MultiMasters service
;
120 error
= ft_face_get_mm_service( face
, &service
);
123 error
= FT_ERR( Invalid_Argument
);
124 if ( service
->set_mm_design
)
125 error
= service
->set_mm_design( face
, num_coords
, coords
);
132 /* documentation is in ftmm.h */
134 FT_EXPORT_DEF( FT_Error
)
135 FT_Set_Var_Design_Coordinates( FT_Face face
,
140 FT_Service_MultiMasters service
;
143 error
= ft_face_get_mm_service( face
, &service
);
146 error
= FT_ERR( Invalid_Argument
);
147 if ( service
->set_var_design
)
148 error
= service
->set_var_design( face
, num_coords
, coords
);
155 /* documentation is in ftmm.h */
157 FT_EXPORT_DEF( FT_Error
)
158 FT_Set_MM_Blend_Coordinates( FT_Face face
,
163 FT_Service_MultiMasters service
;
166 error
= ft_face_get_mm_service( face
, &service
);
169 error
= FT_ERR( Invalid_Argument
);
170 if ( service
->set_mm_blend
)
171 error
= service
->set_mm_blend( face
, num_coords
, coords
);
178 /* documentation is in ftmm.h */
180 /* This is exactly the same as the previous function. It exists for */
183 FT_EXPORT_DEF( FT_Error
)
184 FT_Set_Var_Blend_Coordinates( FT_Face face
,
189 FT_Service_MultiMasters service
;
192 error
= ft_face_get_mm_service( face
, &service
);
195 error
= FT_ERR( Invalid_Argument
);
196 if ( service
->set_mm_blend
)
197 error
= service
->set_mm_blend( face
, num_coords
, coords
);