Bringing apdf from vendor into main branch.
[AROS-Contrib.git] / apdf / freetype2 / base / ftmm.c
blob229a0431654abb586bc9342cc8d6c3dfbe26b4e6
1 /***************************************************************************/
2 /* */
3 /* ftmm.c */
4 /* */
5 /* Multiple Master font support (body). */
6 /* */
7 /* Copyright 1996-2001 by */
8 /* David Turner, Robert Wilhelm, and Werner Lemberg. */
9 /* */
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. */
15 /* */
16 /***************************************************************************/
19 #include <ft2build.h>
20 #include FT_MULTIPLE_MASTERS_H
21 #include FT_INTERNAL_OBJECTS_H
24 /*************************************************************************/
25 /* */
26 /* The macro FT_COMPONENT is used in trace mode. It is an implicit */
27 /* parameter of the FT_TRACE() and FT_ERROR() macros, used to print/log */
28 /* messages during execution. */
29 /* */
30 #undef FT_COMPONENT
31 #define FT_COMPONENT trace_mm
34 /* documentation is in ftmm.h */
36 FT_EXPORT_DEF( FT_Error )
37 FT_Get_Multi_Master( FT_Face face,
38 FT_Multi_Master *amaster )
40 FT_Error error;
43 if ( !face )
44 return FT_Err_Invalid_Face_Handle;
46 error = FT_Err_Invalid_Argument;
48 if ( FT_HAS_MULTIPLE_MASTERS( face ) )
50 FT_Driver driver = face->driver;
51 FT_Get_MM_Func func;
54 func = (FT_Get_MM_Func)driver->root.clazz->get_interface(
55 FT_MODULE( driver ), "get_mm" );
56 if ( func )
57 error = func( face, amaster );
60 return error;
64 /* documentation is in ftmm.h */
66 FT_EXPORT_DEF( FT_Error )
67 FT_Set_MM_Design_Coordinates( FT_Face face,
68 FT_UInt num_coords,
69 FT_Long* coords )
71 FT_Error error;
74 if ( !face )
75 return FT_Err_Invalid_Face_Handle;
77 error = FT_Err_Invalid_Argument;
79 if ( FT_HAS_MULTIPLE_MASTERS( face ) )
81 FT_Driver driver = face->driver;
82 FT_Set_MM_Design_Func func;
85 func = (FT_Set_MM_Design_Func)driver->root.clazz->get_interface(
86 FT_MODULE( driver ), "set_mm_design" );
87 if ( func )
88 error = func( face, num_coords, coords );
91 return error;
95 /* documentation is in ftmm.h */
97 FT_EXPORT_DEF( FT_Error )
98 FT_Set_MM_Blend_Coordinates( FT_Face face,
99 FT_UInt num_coords,
100 FT_Fixed* coords )
102 FT_Error error;
105 if ( !face )
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_Blend_Func func;
116 func = (FT_Set_MM_Blend_Func)driver->root.clazz->get_interface(
117 FT_MODULE( driver ), "set_mm_blend" );
118 if ( func )
119 error = func( face, num_coords, coords );
122 return error;
126 /* END */