Visualization Library 2.0.0-b5

A lightweight C++ OpenGL middleware for 2D/3D graphics

VL     Star     Watch     Fork     Issue

[Download] [Tutorials] [All Classes] [Grouped Classes]
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, 2013 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_INTERNAL_DEBUG_H
21 
22 #include FT_MULTIPLE_MASTERS_H
23 #include FT_INTERNAL_OBJECTS_H
24 #include FT_SERVICE_MULTIPLE_MASTERS_H
25 
26 
27  /*************************************************************************/
28  /* */
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. */
32  /* */
33 #undef FT_COMPONENT
34 #define FT_COMPONENT trace_mm
35 
36 
37  static FT_Error
38  ft_face_get_mm_service( FT_Face face,
39  FT_Service_MultiMasters *aservice )
40  {
42 
43 
44  *aservice = NULL;
45 
46  if ( !face )
47  return FT_THROW( Invalid_Face_Handle );
48 
49  error = FT_ERR( Invalid_Argument );
50 
51  if ( FT_HAS_MULTIPLE_MASTERS( face ) )
52  {
54  *aservice,
55  MULTI_MASTERS );
56 
57  if ( *aservice )
58  error = FT_Err_Ok;
59  }
60 
61  return error;
62  }
63 
64 
65  /* documentation is in ftmm.h */
66 
69  FT_Multi_Master *amaster )
70  {
72  FT_Service_MultiMasters service;
73 
74 
75  error = ft_face_get_mm_service( face, &service );
76  if ( !error )
77  {
78  error = FT_ERR( Invalid_Argument );
79  if ( service->get_mm )
80  error = service->get_mm( face, amaster );
81  }
82 
83  return error;
84  }
85 
86 
87  /* documentation is in ftmm.h */
88 
91  FT_MM_Var* *amaster )
92  {
94  FT_Service_MultiMasters service;
95 
96 
97  error = ft_face_get_mm_service( face, &service );
98  if ( !error )
99  {
100  error = FT_ERR( Invalid_Argument );
101  if ( service->get_mm_var )
102  error = service->get_mm_var( face, amaster );
103  }
104 
105  return error;
106  }
107 
108 
109  /* documentation is in ftmm.h */
110 
113  FT_UInt num_coords,
114  FT_Long* coords )
115  {
116  FT_Error error;
117  FT_Service_MultiMasters service;
118 
119 
120  error = ft_face_get_mm_service( face, &service );
121  if ( !error )
122  {
123  error = FT_ERR( Invalid_Argument );
124  if ( service->set_mm_design )
125  error = service->set_mm_design( face, num_coords, coords );
126  }
127 
128  return error;
129  }
130 
131 
132  /* documentation is in ftmm.h */
133 
136  FT_UInt num_coords,
137  FT_Fixed* coords )
138  {
139  FT_Error error;
140  FT_Service_MultiMasters service;
141 
142 
143  error = ft_face_get_mm_service( face, &service );
144  if ( !error )
145  {
146  error = FT_ERR( Invalid_Argument );
147  if ( service->set_var_design )
148  error = service->set_var_design( face, num_coords, coords );
149  }
150 
151  return error;
152  }
153 
154 
155  /* documentation is in ftmm.h */
156 
159  FT_UInt num_coords,
160  FT_Fixed* coords )
161  {
162  FT_Error error;
163  FT_Service_MultiMasters service;
164 
165 
166  error = ft_face_get_mm_service( face, &service );
167  if ( !error )
168  {
169  error = FT_ERR( Invalid_Argument );
170  if ( service->set_mm_blend )
171  error = service->set_mm_blend( face, num_coords, coords );
172  }
173 
174  return error;
175  }
176 
177 
178  /* documentation is in ftmm.h */
179 
180  /* This is exactly the same as the previous function. It exists for */
181  /* orthogonality. */
182 
185  FT_UInt num_coords,
186  FT_Fixed* coords )
187  {
188  FT_Error error;
189  FT_Service_MultiMasters service;
190 
191 
192  error = ft_face_get_mm_service( face, &service );
193  if ( !error )
194  {
195  error = FT_ERR( Invalid_Argument );
196  if ( service->set_mm_blend )
197  error = service->set_mm_blend( face, num_coords, coords );
198  }
199 
200  return error;
201  }
202 
203 
204 /* END */
int FT_Error
Definition: fttypes.h:296
signed long FT_Long
Definition: fttypes.h:238
FT_Get_MM_Var(FT_Face face, FT_MM_Var **amaster)
Definition: ftmm.c:90
#define NULL
Definition: ftobjs.h:61
return FT_THROW(Missing_Property)
return FT_Err_Ok
Definition: ftbbox.c:645
GLenum GLuint GLint GLenum face
FT_Set_MM_Blend_Coordinates(FT_Face face, FT_UInt num_coords, FT_Fixed *coords)
Definition: ftmm.c:158
#define FT_FACE_LOOKUP_SERVICE(face, ptr, id)
Definition: ftserv.h:705
#define FT_EXPORT_DEF(x)
Definition: ftconfig.h:32
#define FT_ERR(e)
Definition: fttypes.h:582
FT_Error error
Definition: cffdrivr.c:411
FT_Set_Var_Blend_Coordinates(FT_Face face, FT_UInt num_coords, FT_Fixed *coords)
Definition: ftmm.c:184
#define FT_HAS_MULTIPLE_MASTERS(face)
Definition: freetype.h:1238
signed long FT_Fixed
Definition: fttypes.h:284
FT_Set_Var_Design_Coordinates(FT_Face face, FT_UInt num_coords, FT_Fixed *coords)
Definition: ftmm.c:135
unsigned int FT_UInt
Definition: fttypes.h:227
FT_Set_MM_Design_Coordinates(FT_Face face, FT_UInt num_coords, FT_Long *coords)
Definition: ftmm.c:112
FT_Get_Multi_Master(FT_Face face, FT_Multi_Master *amaster)
Definition: ftmm.c:68
GLuint coords