zenilib  0.5.3.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
ftmm.c
Go to the documentation of this file.
1 /***************************************************************************/
2 /* */
3 /* ftmm.c */
4 /* */
5 /* Multiple Master font support (body). */
6 /* */
7 /* Copyright 1996-2001, 2003, 2004, 2009 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 /***************************************************************************/
17 
18 
19 #include <ft2build.h>
20 #include FT_MULTIPLE_MASTERS_H
21 #include FT_INTERNAL_OBJECTS_H
22 #include FT_SERVICE_MULTIPLE_MASTERS_H
23 
24 
25  /*************************************************************************/
26  /* */
27  /* The macro FT_COMPONENT is used in trace mode. It is an implicit */
28  /* parameter of the FT_TRACE() and FT_ERROR() macros, used to print/log */
29  /* messages during execution. */
30  /* */
31 #undef FT_COMPONENT
32 #define FT_COMPONENT trace_mm
33 
34 
35  static FT_Error
37  FT_Service_MultiMasters *aservice )
38  {
40 
41 
42  *aservice = NULL;
43 
44  if ( !face )
45  return FT_Err_Invalid_Face_Handle;
46 
48 
49  if ( FT_HAS_MULTIPLE_MASTERS( face ) )
50  {
52  *aservice,
53  MULTI_MASTERS );
54 
55  if ( *aservice )
56  error = FT_Err_Ok;
57  }
58 
59  return error;
60  }
61 
62 
63  /* documentation is in ftmm.h */
64 
67  FT_Multi_Master *amaster )
68  {
70  FT_Service_MultiMasters service;
71 
72 
73  error = ft_face_get_mm_service( face, &service );
74  if ( !error )
75  {
77  if ( service->get_mm )
78  error = service->get_mm( face, amaster );
79  }
80 
81  return error;
82  }
83 
84 
85  /* documentation is in ftmm.h */
86 
89  FT_MM_Var* *amaster )
90  {
92  FT_Service_MultiMasters service;
93 
94 
95  error = ft_face_get_mm_service( face, &service );
96  if ( !error )
97  {
99  if ( service->get_mm_var )
100  error = service->get_mm_var( face, amaster );
101  }
102 
103  return error;
104  }
105 
106 
107  /* documentation is in ftmm.h */
108 
111  FT_UInt num_coords,
112  FT_Long* coords )
113  {
114  FT_Error error;
115  FT_Service_MultiMasters service;
116 
117 
118  error = ft_face_get_mm_service( face, &service );
119  if ( !error )
120  {
121  error = FT_Err_Invalid_Argument;
122  if ( service->set_mm_design )
123  error = service->set_mm_design( face, num_coords, coords );
124  }
125 
126  return error;
127  }
128 
129 
130  /* documentation is in ftmm.h */
131 
134  FT_UInt num_coords,
135  FT_Fixed* coords )
136  {
137  FT_Error error;
138  FT_Service_MultiMasters service;
139 
140 
141  error = ft_face_get_mm_service( face, &service );
142  if ( !error )
143  {
144  error = FT_Err_Invalid_Argument;
145  if ( service->set_var_design )
146  error = service->set_var_design( face, num_coords, coords );
147  }
148 
149  return error;
150  }
151 
152 
153  /* documentation is in ftmm.h */
154 
157  FT_UInt num_coords,
158  FT_Fixed* coords )
159  {
160  FT_Error error;
161  FT_Service_MultiMasters service;
162 
163 
164  error = ft_face_get_mm_service( face, &service );
165  if ( !error )
166  {
167  error = FT_Err_Invalid_Argument;
168  if ( service->set_mm_blend )
169  error = service->set_mm_blend( face, num_coords, coords );
170  }
171 
172  return error;
173  }
174 
175 
176  /* documentation is in ftmm.h */
177 
178  /* This is exactly the same as the previous function. It exists for */
179  /* orthogonality. */
180 
183  FT_UInt num_coords,
184  FT_Fixed* coords )
185  {
186  FT_Error error;
187  FT_Service_MultiMasters service;
188 
189 
190  error = ft_face_get_mm_service( face, &service );
191  if ( !error )
192  {
193  error = FT_Err_Invalid_Argument;
194  if ( service->set_mm_blend )
195  error = service->set_mm_blend( face, num_coords, coords );
196  }
197 
198  return error;
199  }
200 
201 
202 /* END */
int FT_Error
Definition: fttypes.h:296
FT_Set_MM_Design_Coordinates(FT_Face face, FT_UInt num_coords, FT_Long *coords)
Definition: ftmm.c:110
signed long FT_Long
Definition: fttypes.h:238
#define NULL
Definition: ftobjs.h:61
return FT_Err_Invalid_Argument
Definition: ftbbox.c:584
static FT_Error ft_face_get_mm_service(FT_Face face, FT_Service_MultiMasters *aservice)
Definition: ftmm.c:36
GLenum GLuint coords
Definition: glew.h:7189
return FT_Err_Ok
Definition: ftbbox.c:658
#define FT_FACE_LOOKUP_SERVICE(face, ptr, id)
Definition: ftserv.h:625
FT_Error error
Definition: cffdrivr.c:407
GLenum face
Definition: gl2ext.h:1490
FT_Set_Var_Blend_Coordinates(FT_Face face, FT_UInt num_coords, FT_Fixed *coords)
Definition: ftmm.c:182
FT_Set_MM_Blend_Coordinates(FT_Face face, FT_UInt num_coords, FT_Fixed *coords)
Definition: ftmm.c:156
FT_Get_Multi_Master(FT_Face face, FT_Multi_Master *amaster)
Definition: ftmm.c:66
#define FT_HAS_MULTIPLE_MASTERS(face)
Definition: freetype.h:1231
signed long FT_Fixed
Definition: fttypes.h:284
#define FT_EXPORT_DEF(x)
Definition: ftconfig.h:511
unsigned int FT_UInt
Definition: fttypes.h:227
FT_Get_MM_Var(FT_Face face, FT_MM_Var **amaster)
Definition: ftmm.c:88
FT_Set_Var_Design_Coordinates(FT_Face face, FT_UInt num_coords, FT_Fixed *coords)
Definition: ftmm.c:133