1 /***************************************************************************/
5 /* Multiple Master font support (body). */
7 /* Copyright 1996-2001, 2003, 2004, 2009, 2013, 2014 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 /* check of `face' delayed to `ft_face_get_mm_service' */
78 return FT_THROW( Invalid_Argument );
80 error = ft_face_get_mm_service( face, &service );
83 error = FT_ERR( Invalid_Argument );
84 if ( service->get_mm )
85 error = service->get_mm( face, amaster );
92 /* documentation is in ftmm.h */
94 FT_EXPORT_DEF( FT_Error )
95 FT_Get_MM_Var( FT_Face face,
99 FT_Service_MultiMasters service;
102 /* check of `face' delayed to `ft_face_get_mm_service' */
105 return FT_THROW( Invalid_Argument );
107 error = ft_face_get_mm_service( face, &service );
110 error = FT_ERR( Invalid_Argument );
111 if ( service->get_mm_var )
112 error = service->get_mm_var( face, amaster );
119 /* documentation is in ftmm.h */
121 FT_EXPORT_DEF( FT_Error )
122 FT_Set_MM_Design_Coordinates( FT_Face face,
127 FT_Service_MultiMasters service;
130 /* check of `face' delayed to `ft_face_get_mm_service' */
133 return FT_THROW( Invalid_Argument );
135 error = ft_face_get_mm_service( face, &service );
138 error = FT_ERR( Invalid_Argument );
139 if ( service->set_mm_design )
140 error = service->set_mm_design( face, num_coords, coords );
147 /* documentation is in ftmm.h */
149 FT_EXPORT_DEF( FT_Error )
150 FT_Set_Var_Design_Coordinates( FT_Face face,
155 FT_Service_MultiMasters service;
158 /* check of `face' delayed to `ft_face_get_mm_service' */
161 return FT_THROW( Invalid_Argument );
163 error = ft_face_get_mm_service( face, &service );
166 error = FT_ERR( Invalid_Argument );
167 if ( service->set_var_design )
168 error = service->set_var_design( face, num_coords, coords );
175 /* documentation is in ftmm.h */
177 FT_EXPORT_DEF( FT_Error )
178 FT_Set_MM_Blend_Coordinates( FT_Face face,
183 FT_Service_MultiMasters service;
186 /* check of `face' delayed to `ft_face_get_mm_service' */
189 return FT_THROW( Invalid_Argument );
191 error = ft_face_get_mm_service( face, &service );
194 error = FT_ERR( Invalid_Argument );
195 if ( service->set_mm_blend )
196 error = service->set_mm_blend( face, num_coords, coords );
203 /* documentation is in ftmm.h */
205 /* This is exactly the same as the previous function. It exists for */
208 FT_EXPORT_DEF( FT_Error )
209 FT_Set_Var_Blend_Coordinates( FT_Face face,
214 FT_Service_MultiMasters service;
217 /* check of `face' delayed to `ft_face_get_mm_service' */
220 return FT_THROW( Invalid_Argument );
222 error = ft_face_get_mm_service( face, &service );
225 error = FT_ERR( Invalid_Argument );
226 if ( service->set_mm_blend )
227 error = service->set_mm_blend( face, num_coords, coords );