zenilib: zenilib/jni/external/freetype2/src/base/ftgxval.c Source File

zenilib 0.5.3.0

- Main Page
- Modules
- Namespaces
- Classes
- Files

- File List
- File Members

All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
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, 2005, 2006, 2010 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_OBJECTS_H
30 #include FT_SERVICE_GX_VALIDATE_H
31
32
33 /* documentation is in ftgxval.h */
34
35 FT_EXPORT_DEF( FT_Error )
36 FT_TrueTypeGX_Validate( FT_Face face,
37 FT_UInt validation_flags,
38 FT_Bytes tables[FT_VALIDATE_GX_LENGTH],
39 FT_UInt table_length )
40 {
41 FT_Service_GXvalidate service;
42 FT_Error error;
43
44
45 if ( !face )
46 {
47 error = FT_Err_Invalid_Face_Handle;
48 goto Exit;
49 }
50
51 if ( tables == NULL )
52 {
53 error = FT_Err_Invalid_Argument;
54 goto Exit;
55 }
56
57 FT_FACE_FIND_GLOBAL_SERVICE( face, service, GX_VALIDATE );
58
59 if ( service )
60 error = service->validate( face,
61 validation_flags,
62 tables,
63 table_length );
64 else
65 error = FT_Err_Unimplemented_Feature;
66
67 Exit:
68 return error;
69 }
70
71
72 FT_EXPORT_DEF( void )
73 FT_TrueTypeGX_Free( FT_Face face,
74 FT_Bytes table )
75 {
76 FT_Memory memory;
77
78
79 if ( !face )
80 return;
81
82 memory = FT_FACE_MEMORY( face );
83
84 FT_FREE( table );
85 }
86
87
88 FT_EXPORT_DEF( FT_Error )
89 FT_ClassicKern_Validate( FT_Face face,
90 FT_UInt validation_flags,
91 FT_Bytes *ckern_table )
92 {
93 FT_Service_CKERNvalidate service;
94 FT_Error error;
95
96
97 if ( !face )
98 {
99 error = FT_Err_Invalid_Face_Handle;
100 goto Exit;
101 }
102
103 if ( ckern_table == NULL )
104 {
105 error = FT_Err_Invalid_Argument;
106 goto Exit;
107 }
108
109 FT_FACE_FIND_GLOBAL_SERVICE( face, service, CLASSICKERN_VALIDATE );
110
111 if ( service )
112 error = service->validate( face,
113 validation_flags,
114 ckern_table );
115 else
116 error = FT_Err_Unimplemented_Feature;
117
118 Exit:
119 return error;
120 }
121
122
123 FT_EXPORT_DEF( void )
124 FT_ClassicKern_Free( FT_Face face,
125 FT_Bytes table )
126 {
127 FT_Memory memory;
128
129
130 if ( !face )
131 return;
132
133 memory = FT_FACE_MEMORY( face );
134
135
136 FT_FREE( table );
137 }
138
139
140 /* END */
table
GLenum GLsizei GLenum GLenum const GLvoid * table
Definition: glew.h:4422
FT_Error
int FT_Error
Definition: fttypes.h:296
NULL
#define NULL
Definition: ftobjs.h:61
FT_Err_Invalid_Argument
return FT_Err_Invalid_Argument
Definition: ftbbox.c:584
FT_FACE_FIND_GLOBAL_SERVICE
#define FT_FACE_FIND_GLOBAL_SERVICE(face, ptr, id)
Definition: ftserv.h:132
FT_ClassicKern_Validate
FT_ClassicKern_Validate(FT_Face face, FT_UInt validation_flags, FT_Bytes *ckern_table)
Definition: ftgxval.c:89
FT_VALIDATE_GX_LENGTH
#define FT_VALIDATE_GX_LENGTH
Definition: ftgxval.h:94
FT_FREE
#define FT_FREE(ptr)
Definition: ftmemory.h:286
FT_TrueTypeGX_Validate
FT_TrueTypeGX_Validate(FT_Face face, FT_UInt validation_flags, FT_Bytes tables[FT_VALIDATE_GX_LENGTH], FT_UInt table_length)
Definition: ftgxval.c:36
FT_FaceRec_
Definition: freetype.h:912
error
FT_Error error
Definition: cffdrivr.c:407
face
GLenum face
Definition: gl2ext.h:1490
FT_Bytes
const FT_Byte * FT_Bytes
Definition: fttypes.h:161
FT_TrueTypeGX_Free
FT_TrueTypeGX_Free(FT_Face face, FT_Bytes table)
Definition: ftgxval.c:73
FT_Memory
typedefFT_BEGIN_HEADER struct FT_MemoryRec_ * FT_Memory
Definition: ftsystem.h:66
FT_FACE_MEMORY
#define FT_FACE_MEMORY(x)
Definition: ftobjs.h:529
FT_ClassicKern_Free
FT_ClassicKern_Free(FT_Face face, FT_Bytes table)
Definition: ftgxval.c:124
ft2build.h
FT_EXPORT_DEF
#define FT_EXPORT_DEF(x)
Definition: ftconfig.h:511
FT_UInt
unsigned int FT_UInt
Definition: fttypes.h:227