1 /***************************************************************************/
5 /* Multiple Master font support (body). */
7 /* Copyright 1996-2000 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 /***************************************************************************/
19 #include <freetype/ftmm.h>
20 #include <freetype/internal/ftobjs.h>
23 /*************************************************************************/
25 /* The macro FT_COMPONENT is used in trace mode. It is an implicit */
26 /* parameter of the FT_TRACE() and FT_ERROR() macros, used to print/log */
27 /* messages during execution. */
30 #define FT_COMPONENT trace_mm
33 /*************************************************************************/
36 /* FT_Get_Multi_Master */
39 /* Retrieves the Multiple Master descriptor of a given font. */
42 /* face :: A handle to the source face. */
45 /* master :: The Multiple Masters descriptor. */
48 /* FreeType error code. 0 means success. */
50 FT_EXPORT_FUNC( FT_Error
) FT_Get_Multi_Master( FT_Face face
,
51 FT_Multi_Master
* master
)
57 return FT_Err_Invalid_Face_Handle
;
59 error
= FT_Err_Invalid_Argument
;
61 if ( FT_HAS_MULTIPLE_MASTERS( face
) )
63 FT_Driver driver
= face
->driver
;
67 func
= (FT_Get_MM_Func
)driver
->root
.clazz
->get_interface(
68 FT_MODULE( driver
), "get_mm" );
70 error
= func( face
, master
);
77 /*************************************************************************/
80 /* FT_Set_MM_Design_Coordinates */
83 /* For Multiple Masters fonts, choose an interpolated font design */
84 /* through design coordinates. */
87 /* face :: A handle to the source face. */
89 /* num_coords :: The number of design coordinates (must be equal to */
90 /* the number of axes in the font). */
92 /* coords :: The design coordinates. */
95 /* FreeType error code. 0 means success. */
97 FT_EXPORT_FUNC( FT_Error
) FT_Set_MM_Design_Coordinates(
106 return FT_Err_Invalid_Face_Handle
;
108 error
= FT_Err_Invalid_Argument
;
110 if ( FT_HAS_MULTIPLE_MASTERS( face
) )
112 FT_Driver driver
= face
->driver
;
113 FT_Set_MM_Design_Func func
;
116 func
= (FT_Set_MM_Design_Func
)driver
->root
.clazz
->get_interface(
117 FT_MODULE( driver
), "set_mm_design" );
119 error
= func( face
, num_coords
, coords
);
126 /*************************************************************************/
129 /* FT_Set_MM_Blend_Coordinates */
132 /* For Multiple Masters fonts, choose an interpolated font design */
133 /* through normalized blend coordinates. */
136 /* face :: A handle to the source face. */
138 /* num_coords :: The number of design coordinates (must be equal to */
139 /* the number of axes in the font). */
141 /* coords :: The design coordinates (each one must be between 0 */
145 /* FreeType error code. 0 means success. */
147 FT_EXPORT_FUNC( FT_Error
) FT_Set_MM_Blend_Coordinates(
156 return FT_Err_Invalid_Face_Handle
;
158 error
= FT_Err_Invalid_Argument
;
160 if ( FT_HAS_MULTIPLE_MASTERS( face
) )
162 FT_Driver driver
= face
->driver
;
163 FT_Set_MM_Blend_Func func
;
166 func
= (FT_Set_MM_Blend_Func
)driver
->root
.clazz
->get_interface(
167 FT_MODULE( driver
), "set_mm_blend" );
169 error
= func( face
, num_coords
, coords
);