ReactOS 0.4.16-dev-2354-g16de117
ftmm.c File Reference
Include dependency graph for ftmm.c:

Go to the source code of this file.

Macros

#define FT_COMPONENT   mm
 

Functions

static FT_Error ft_face_get_mm_service (FT_Face face, FT_Service_MultiMasters *aservice)
 
static FT_Error ft_face_get_mvar_service (FT_Face face, FT_Service_MetricsVariations *aservice)
 
 FT_Get_Multi_Master (FT_Face face, FT_Multi_Master *amaster)
 
 FT_Get_MM_Var (FT_Face face, FT_MM_Var **amaster)
 
 FT_Done_MM_Var (FT_Library library, FT_MM_Var *amaster)
 
 FT_Set_MM_Design_Coordinates (FT_Face face, FT_UInt num_coords, FT_Long *coords)
 
 FT_Set_MM_WeightVector (FT_Face face, FT_UInt len, FT_Fixed *weightvector)
 
 FT_Get_MM_WeightVector (FT_Face face, FT_UInt *len, FT_Fixed *weightvector)
 
 FT_Set_Var_Design_Coordinates (FT_Face face, FT_UInt num_coords, FT_Fixed *coords)
 
 FT_Get_Var_Design_Coordinates (FT_Face face, FT_UInt num_coords, FT_Fixed *coords)
 
 FT_Set_MM_Blend_Coordinates (FT_Face face, FT_UInt num_coords, FT_Fixed *coords)
 
 FT_Set_Var_Blend_Coordinates (FT_Face face, FT_UInt num_coords, FT_Fixed *coords)
 
 FT_Get_MM_Blend_Coordinates (FT_Face face, FT_UInt num_coords, FT_Fixed *coords)
 
 FT_Get_Var_Blend_Coordinates (FT_Face face, FT_UInt num_coords, FT_Fixed *coords)
 
 FT_Get_Var_Axis_Flags (FT_MM_Var *master, FT_UInt axis_index, FT_UInt *flags)
 
 FT_Set_Named_Instance (FT_Face face, FT_UInt instance_index)
 

Macro Definition Documentation

◆ FT_COMPONENT

#define FT_COMPONENT   mm

Definition at line 34 of file ftmm.c.

Function Documentation

◆ FT_Done_MM_Var()

FT_Done_MM_Var ( FT_Library  library,
FT_MM_Var amaster 
)

Definition at line 150 of file ftmm.c.

152 {
154
155
156 if ( !library )
157 return FT_THROW( Invalid_Library_Handle );
158
160 FT_FREE( amaster );
161
162 return FT_Err_Ok;
163 }
FT_Library library
Definition: cffdrivr.c:660
return FT_Err_Ok
Definition: ftbbox.c:526
#define FT_THROW(e)
Definition: ftdebug.h:243
#define FT_FREE(ptr)
Definition: ftmemory.h:337
typedefFT_BEGIN_HEADER struct FT_MemoryRec_ * FT_Memory
Definition: ftsystem.h:64
static char memory[1024 *256]
Definition: process.c:122
FT_Memory memory
Definition: ftobjs.h:895

◆ ft_face_get_mm_service()

static FT_Error ft_face_get_mm_service ( FT_Face  face,
FT_Service_MultiMasters *  aservice 
)
static

Definition at line 38 of file ftmm.c.

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
52 {
54 *aservice,
55 MULTI_MASTERS );
56
57 if ( *aservice )
59 }
60
61 return error;
62 }
#define NULL
Definition: types.h:112
#define FT_HAS_MULTIPLE_MASTERS(face)
Definition: freetype.h:1361
#define FT_FACE_LOOKUP_SERVICE(face, ptr, id)
Definition: ftserv.h:456
int FT_Error
Definition: fttypes.h:299
#define FT_ERR(e)
Definition: fttypes.h:599
GLenum GLuint GLint GLenum face
Definition: glext.h:7025
#define error(str)
Definition: mkdosfs.c:1605

Referenced by FT_Get_MM_Blend_Coordinates(), FT_Get_MM_Var(), FT_Get_MM_WeightVector(), FT_Get_Multi_Master(), FT_Get_Var_Blend_Coordinates(), FT_Get_Var_Design_Coordinates(), FT_Set_MM_Blend_Coordinates(), FT_Set_MM_Design_Coordinates(), FT_Set_MM_WeightVector(), FT_Set_Named_Instance(), FT_Set_Var_Blend_Coordinates(), and FT_Set_Var_Design_Coordinates().

◆ ft_face_get_mvar_service()

static FT_Error ft_face_get_mvar_service ( FT_Face  face,
FT_Service_MetricsVariations *  aservice 
)
static

Definition at line 66 of file ftmm.c.

68 {
70
71
72 *aservice = NULL;
73
74 if ( !face )
75 return FT_THROW( Invalid_Face_Handle );
76
77 error = FT_ERR( Invalid_Argument );
78
80 {
82 *aservice,
83 METRICS_VARIATIONS );
84
85 if ( *aservice )
87 }
88
89 return error;
90 }

Referenced by FT_Set_MM_Blend_Coordinates(), FT_Set_Named_Instance(), FT_Set_Var_Blend_Coordinates(), and FT_Set_Var_Design_Coordinates().

◆ FT_Get_MM_Blend_Coordinates()

FT_Get_MM_Blend_Coordinates ( FT_Face  face,
FT_UInt  num_coords,
FT_Fixed coords 
)

Definition at line 440 of file ftmm.c.

443 {
445 FT_Service_MultiMasters service;
446
447
448 /* check of `face' delayed to `ft_face_get_mm_service' */
449
450 if ( !coords )
451 return FT_THROW( Invalid_Argument );
452
453 error = ft_face_get_mm_service( face, &service );
454 if ( !error )
455 {
456 error = FT_ERR( Invalid_Argument );
457 if ( service->get_mm_blend )
458 error = service->get_mm_blend( face, num_coords, coords );
459 }
460
461 return error;
462 }
static FT_Error ft_face_get_mm_service(FT_Face face, FT_Service_MultiMasters *aservice)
Definition: ftmm.c:38
GLuint coords
Definition: glext.h:7368

◆ FT_Get_MM_Var()

FT_Get_MM_Var ( FT_Face  face,
FT_MM_Var **  amaster 
)

Definition at line 123 of file ftmm.c.

125 {
127 FT_Service_MultiMasters service;
128
129
130 /* check of `face' delayed to `ft_face_get_mm_service' */
131
132 if ( !amaster )
133 return FT_THROW( Invalid_Argument );
134
135 error = ft_face_get_mm_service( face, &service );
136 if ( !error )
137 {
138 error = FT_ERR( Invalid_Argument );
139 if ( service->get_mm_var )
140 error = service->get_mm_var( face, amaster );
141 }
142
143 return error;
144 }

◆ FT_Get_MM_WeightVector()

FT_Get_MM_WeightVector ( FT_Face  face,
FT_UInt len,
FT_Fixed weightvector 
)

Definition at line 237 of file ftmm.c.

240 {
242 FT_Service_MultiMasters service;
243
244
245 /* check of `face' delayed to `ft_face_get_mm_service' */
246
247 if ( len && !weightvector )
248 return FT_THROW( Invalid_Argument );
249
250 error = ft_face_get_mm_service( face, &service );
251 if ( !error )
252 {
253 error = FT_ERR( Invalid_Argument );
254 if ( service->get_mm_weightvector )
255 error = service->get_mm_weightvector( face, len, weightvector );
256 }
257
258 return error;
259 }
GLenum GLsizei len
Definition: glext.h:6722

◆ FT_Get_Multi_Master()

FT_Get_Multi_Master ( FT_Face  face,
FT_Multi_Master amaster 
)

Definition at line 96 of file ftmm.c.

98 {
100 FT_Service_MultiMasters service;
101
102
103 /* check of `face' delayed to `ft_face_get_mm_service' */
104
105 if ( !amaster )
106 return FT_THROW( Invalid_Argument );
107
108 error = ft_face_get_mm_service( face, &service );
109 if ( !error )
110 {
111 error = FT_ERR( Invalid_Argument );
112 if ( service->get_mm )
113 error = service->get_mm( face, amaster );
114 }
115
116 return error;
117 }

◆ FT_Get_Var_Axis_Flags()

FT_Get_Var_Axis_Flags ( FT_MM_Var master,
FT_UInt  axis_index,
FT_UInt flags 
)

Definition at line 499 of file ftmm.c.

502 {
503 FT_UShort* axis_flags;
504
505
506 if ( !master || !flags )
507 return FT_THROW( Invalid_Argument );
508
509 if ( axis_index >= master->num_axis )
510 return FT_THROW( Invalid_Argument );
511
512 /* the axis flags array immediately follows the data of `master' */
513 axis_flags = (FT_UShort*)&( master[1] );
514 *flags = axis_flags[axis_index];
515
516 return FT_Err_Ok;
517 }
unsigned short FT_UShort
Definition: fttypes.h:209
GLbitfield flags
Definition: glext.h:7161
FT_UInt num_axis
Definition: ftmm.h:244

◆ FT_Get_Var_Blend_Coordinates()

FT_Get_Var_Blend_Coordinates ( FT_Face  face,
FT_UInt  num_coords,
FT_Fixed coords 
)

Definition at line 471 of file ftmm.c.

474 {
476 FT_Service_MultiMasters service;
477
478
479 /* check of `face' delayed to `ft_face_get_mm_service' */
480
481 if ( !coords )
482 return FT_THROW( Invalid_Argument );
483
484 error = ft_face_get_mm_service( face, &service );
485 if ( !error )
486 {
487 error = FT_ERR( Invalid_Argument );
488 if ( service->get_mm_blend )
489 error = service->get_mm_blend( face, num_coords, coords );
490 }
491
492 return error;
493 }

◆ FT_Get_Var_Design_Coordinates()

FT_Get_Var_Design_Coordinates ( FT_Face  face,
FT_UInt  num_coords,
FT_Fixed coords 
)

Definition at line 313 of file ftmm.c.

316 {
318 FT_Service_MultiMasters service;
319
320
321 /* check of `face' delayed to `ft_face_get_mm_service' */
322
323 if ( !coords )
324 return FT_THROW( Invalid_Argument );
325
326 error = ft_face_get_mm_service( face, &service );
327 if ( !error )
328 {
329 error = FT_ERR( Invalid_Argument );
330 if ( service->get_var_design )
331 error = service->get_var_design( face, num_coords, coords );
332 }
333
334 return error;
335 }

◆ FT_Set_MM_Blend_Coordinates()

FT_Set_MM_Blend_Coordinates ( FT_Face  face,
FT_UInt  num_coords,
FT_Fixed coords 
)

Definition at line 341 of file ftmm.c.

344 {
346 FT_Service_MultiMasters service_mm = NULL;
347 FT_Service_MetricsVariations service_mvar = NULL;
348
349
350 /* check of `face' delayed to `ft_face_get_mm_service' */
351
352 if ( num_coords && !coords )
353 return FT_THROW( Invalid_Argument );
354
355 error = ft_face_get_mm_service( face, &service_mm );
356 if ( !error )
357 {
358 error = FT_ERR( Invalid_Argument );
359 if ( service_mm->set_mm_blend )
360 error = service_mm->set_mm_blend( face, num_coords, coords );
361
362 /* internal error code -1 means `no change'; we can exit immediately */
363 if ( error == -1 )
364 return FT_Err_Ok;
365 }
366
367 if ( !error )
368 {
369 (void)ft_face_get_mvar_service( face, &service_mvar );
370
371 if ( service_mvar && service_mvar->metrics_adjust )
372 service_mvar->metrics_adjust( face );
373 }
374
375 /* enforce recomputation of auto-hinting data */
376 if ( !error && face->autohint.finalizer )
377 {
378 face->autohint.finalizer( face->autohint.data );
379 face->autohint.data = NULL;
380 }
381
382 return error;
383 }
static FT_Error ft_face_get_mvar_service(FT_Face face, FT_Service_MetricsVariations *aservice)
Definition: ftmm.c:66

◆ FT_Set_MM_Design_Coordinates()

FT_Set_MM_Design_Coordinates ( FT_Face  face,
FT_UInt  num_coords,
FT_Long coords 
)

Definition at line 169 of file ftmm.c.

172 {
174 FT_Service_MultiMasters service;
175
176
177 /* check of `face' delayed to `ft_face_get_mm_service' */
178
179 if ( num_coords && !coords )
180 return FT_THROW( Invalid_Argument );
181
182 error = ft_face_get_mm_service( face, &service );
183 if ( !error )
184 {
185 error = FT_ERR( Invalid_Argument );
186 if ( service->set_mm_design )
187 error = service->set_mm_design( face, num_coords, coords );
188 }
189
190 /* enforce recomputation of auto-hinting data */
191 if ( !error && face->autohint.finalizer )
192 {
193 face->autohint.finalizer( face->autohint.data );
194 face->autohint.data = NULL;
195 }
196
197 return error;
198 }

◆ FT_Set_MM_WeightVector()

FT_Set_MM_WeightVector ( FT_Face  face,
FT_UInt  len,
FT_Fixed weightvector 
)

Definition at line 204 of file ftmm.c.

207 {
209 FT_Service_MultiMasters service;
210
211
212 /* check of `face' delayed to `ft_face_get_mm_service' */
213
214 if ( len && !weightvector )
215 return FT_THROW( Invalid_Argument );
216
217 error = ft_face_get_mm_service( face, &service );
218 if ( !error )
219 {
220 error = FT_ERR( Invalid_Argument );
221 if ( service->set_mm_weightvector )
222 error = service->set_mm_weightvector( face, len, weightvector );
223 }
224
225 /* enforce recomputation of auto-hinting data */
226 if ( !error && face->autohint.finalizer )
227 {
228 face->autohint.finalizer( face->autohint.data );
229 face->autohint.data = NULL;
230 }
231
232 return error;
233 }

◆ FT_Set_Named_Instance()

FT_Set_Named_Instance ( FT_Face  face,
FT_UInt  instance_index 
)

Definition at line 523 of file ftmm.c.

525 {
527
528 FT_Service_MultiMasters service_mm = NULL;
529 FT_Service_MetricsVariations service_mvar = NULL;
530
531
532 /* check of `face' delayed to `ft_face_get_mm_service' */
533
534 error = ft_face_get_mm_service( face, &service_mm );
535 if ( !error )
536 {
537 error = FT_ERR( Invalid_Argument );
538 if ( service_mm->set_instance )
539 error = service_mm->set_instance( face, instance_index );
540 }
541
542 if ( !error )
543 {
544 (void)ft_face_get_mvar_service( face, &service_mvar );
545
546 if ( service_mvar && service_mvar->metrics_adjust )
547 service_mvar->metrics_adjust( face );
548 }
549
550 /* enforce recomputation of auto-hinting data */
551 if ( !error && face->autohint.finalizer )
552 {
553 face->autohint.finalizer( face->autohint.data );
554 face->autohint.data = NULL;
555 }
556
557 if ( !error )
558 {
559 face->face_index = ( instance_index << 16 ) |
560 ( face->face_index & 0xFFFFL );
561 face->face_flags &= ~FT_FACE_FLAG_VARIATION;
562 }
563
564 return error;
565 }

◆ FT_Set_Var_Blend_Coordinates()

FT_Set_Var_Blend_Coordinates ( FT_Face  face,
FT_UInt  num_coords,
FT_Fixed coords 
)

Definition at line 392 of file ftmm.c.

395 {
397 FT_Service_MultiMasters service_mm = NULL;
398 FT_Service_MetricsVariations service_mvar = NULL;
399
400
401 /* check of `face' delayed to `ft_face_get_mm_service' */
402
403 if ( num_coords && !coords )
404 return FT_THROW( Invalid_Argument );
405
406 error = ft_face_get_mm_service( face, &service_mm );
407 if ( !error )
408 {
409 error = FT_ERR( Invalid_Argument );
410 if ( service_mm->set_mm_blend )
411 error = service_mm->set_mm_blend( face, num_coords, coords );
412
413 /* internal error code -1 means `no change'; we can exit immediately */
414 if ( error == -1 )
415 return FT_Err_Ok;
416 }
417
418 if ( !error )
419 {
420 (void)ft_face_get_mvar_service( face, &service_mvar );
421
422 if ( service_mvar && service_mvar->metrics_adjust )
423 service_mvar->metrics_adjust( face );
424 }
425
426 /* enforce recomputation of auto-hinting data */
427 if ( !error && face->autohint.finalizer )
428 {
429 face->autohint.finalizer( face->autohint.data );
430 face->autohint.data = NULL;
431 }
432
433 return error;
434 }

◆ FT_Set_Var_Design_Coordinates()

FT_Set_Var_Design_Coordinates ( FT_Face  face,
FT_UInt  num_coords,
FT_Fixed coords 
)

Definition at line 265 of file ftmm.c.

268 {
270 FT_Service_MultiMasters service_mm = NULL;
271 FT_Service_MetricsVariations service_mvar = NULL;
272
273
274 /* check of `face' delayed to `ft_face_get_mm_service' */
275
276 if ( num_coords && !coords )
277 return FT_THROW( Invalid_Argument );
278
279 error = ft_face_get_mm_service( face, &service_mm );
280 if ( !error )
281 {
282 error = FT_ERR( Invalid_Argument );
283 if ( service_mm->set_var_design )
284 error = service_mm->set_var_design( face, num_coords, coords );
285
286 /* internal error code -1 means `no change'; we can exit immediately */
287 if ( error == -1 )
288 return FT_Err_Ok;
289 }
290
291 if ( !error )
292 {
293 (void)ft_face_get_mvar_service( face, &service_mvar );
294
295 if ( service_mvar && service_mvar->metrics_adjust )
296 service_mvar->metrics_adjust( face );
297 }
298
299 /* enforce recomputation of auto-hinting data */
300 if ( !error && face->autohint.finalizer )
301 {
302 face->autohint.finalizer( face->autohint.data );
303 face->autohint.data = NULL;
304 }
305
306 return error;
307 }