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]
ftgxval.c
Go to the documentation of this file.
1 /***************************************************************************/
2 /* */
3 /* ftgxval.c */
4 /* */
5 /* FreeType API for validating TrueTyepGX/AAT tables (body). */
6 /* */
7 /* Copyright 2004-2006, 2010, 2013 by */
8 /* Masatake YAMATO, Redhat K.K, */
9 /* David Turner, Robert Wilhelm, and Werner Lemberg. */
10 /* */
11 /* This file is part of the FreeType project, and may only be used, */
12 /* modified, and distributed under the terms of the FreeType project */
13 /* license, LICENSE.TXT. By continuing to use, modify, or distribute */
14 /* this file you indicate that you have read the license and */
15 /* understand and accept it fully. */
16 /* */
17 /***************************************************************************/
18 
19 /***************************************************************************/
20 /* */
21 /* gxvalid is derived from both gxlayout module and otvalid module. */
22 /* Development of gxlayout is supported by the Information-technology */
23 /* Promotion Agency(IPA), Japan. */
24 /* */
25 /***************************************************************************/
26 
27 
28 #include <ft2build.h>
29 #include FT_INTERNAL_DEBUG_H
30 
31 #include FT_INTERNAL_OBJECTS_H
32 #include FT_SERVICE_GX_VALIDATE_H
33 
34 
35  /* documentation is in ftgxval.h */
36 
39  FT_UInt validation_flags,
41  FT_UInt table_length )
42  {
43  FT_Service_GXvalidate service;
45 
46 
47  if ( !face )
48  {
49  error = FT_THROW( Invalid_Face_Handle );
50  goto Exit;
51  }
52 
53  if ( tables == NULL )
54  {
55  error = FT_THROW( Invalid_Argument );
56  goto Exit;
57  }
58 
59  FT_FACE_FIND_GLOBAL_SERVICE( face, service, GX_VALIDATE );
60 
61  if ( service )
62  error = service->validate( face,
63  validation_flags,
64  tables,
65  table_length );
66  else
67  error = FT_THROW( Unimplemented_Feature );
68 
69  Exit:
70  return error;
71  }
72 
73 
74  FT_EXPORT_DEF( void )
76  FT_Bytes table )
77  {
78  FT_Memory memory;
79 
80 
81  if ( !face )
82  return;
83 
84  memory = FT_FACE_MEMORY( face );
85 
86  FT_FREE( table );
87  }
88 
89 
92  FT_UInt validation_flags,
93  FT_Bytes *ckern_table )
94  {
95  FT_Service_CKERNvalidate service;
97 
98 
99  if ( !face )
100  {
101  error = FT_THROW( Invalid_Face_Handle );
102  goto Exit;
103  }
104 
105  if ( ckern_table == NULL )
106  {
107  error = FT_THROW( Invalid_Argument );
108  goto Exit;
109  }
110 
111  FT_FACE_FIND_GLOBAL_SERVICE( face, service, CLASSICKERN_VALIDATE );
112 
113  if ( service )
114  error = service->validate( face,
115  validation_flags,
116  ckern_table );
117  else
118  error = FT_THROW( Unimplemented_Feature );
119 
120  Exit:
121  return error;
122  }
123 
124 
125  FT_EXPORT_DEF( void )
127  FT_Bytes table )
128  {
129  FT_Memory memory;
130 
131 
132  if ( !face )
133  return;
134 
135  memory = FT_FACE_MEMORY( face );
136 
137 
138  FT_FREE( table );
139  }
140 
141 
142 /* END */
int FT_Error
Definition: fttypes.h:296
FT_TrueTypeGX_Free(FT_Face face, FT_Bytes table)
Definition: ftgxval.c:75
#define NULL
Definition: ftobjs.h:61
return FT_THROW(Missing_Property)
#define FT_FACE_FIND_GLOBAL_SERVICE(face, ptr, id)
Definition: ftserv.h:133
FT_ClassicKern_Validate(FT_Face face, FT_UInt validation_flags, FT_Bytes *ckern_table)
Definition: ftgxval.c:91
GLenum GLuint GLint GLenum face
#define FT_VALIDATE_GX_LENGTH
Definition: ftgxval.h:94
FT_ClassicKern_Free(FT_Face face, FT_Bytes table)
Definition: ftgxval.c:126
#define FT_FREE(ptr)
Definition: ftmemory.h:286
#define FT_EXPORT_DEF(x)
Definition: ftconfig.h:32
FT_Error error
Definition: cffdrivr.c:411
const FT_Byte * FT_Bytes
Definition: fttypes.h:161
typedefFT_BEGIN_HEADER struct FT_MemoryRec_ * FT_Memory
Definition: ftsystem.h:66
#define FT_FACE_MEMORY(x)
Definition: ftobjs.h:563
unsigned int FT_UInt
Definition: fttypes.h:227
GLenum GLsizei GLenum GLenum const GLvoid * table
FT_TrueTypeGX_Validate(FT_Face face, FT_UInt validation_flags, FT_Bytes tables[FT_VALIDATE_GX_LENGTH], FT_UInt table_length)
Definition: ftgxval.c:38