zenilib  0.5.3.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
ftotval.c
Go to the documentation of this file.
1 /***************************************************************************/
2 /* */
3 /* ftotval.c */
4 /* */
5 /* FreeType API for validating OpenType tables (body). */
6 /* */
7 /* Copyright 2004, 2006, 2008, 2010 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 #include <ft2build.h>
19 #include FT_INTERNAL_OBJECTS_H
20 #include FT_SERVICE_OPENTYPE_VALIDATE_H
21 #include FT_OPENTYPE_VALIDATE_H
22 
23 
24  /* documentation is in ftotval.h */
25 
28  FT_UInt validation_flags,
29  FT_Bytes *BASE_table,
30  FT_Bytes *GDEF_table,
31  FT_Bytes *GPOS_table,
32  FT_Bytes *GSUB_table,
33  FT_Bytes *JSTF_table )
34  {
35  FT_Service_OTvalidate service;
37 
38 
39  if ( !face )
40  {
41  error = FT_Err_Invalid_Face_Handle;
42  goto Exit;
43  }
44 
45  if ( !( BASE_table &&
46  GDEF_table &&
47  GPOS_table &&
48  GSUB_table &&
49  JSTF_table ) )
50  {
52  goto Exit;
53  }
54 
55  FT_FACE_FIND_GLOBAL_SERVICE( face, service, OPENTYPE_VALIDATE );
56 
57  if ( service )
58  error = service->validate( face,
59  validation_flags,
60  BASE_table,
61  GDEF_table,
62  GPOS_table,
63  GSUB_table,
64  JSTF_table );
65  else
66  error = FT_Err_Unimplemented_Feature;
67 
68  Exit:
69  return error;
70  }
71 
72 
73  FT_EXPORT_DEF( void )
75  FT_Bytes table )
76  {
77  FT_Memory memory;
78 
79 
80  if ( !face )
81  return;
82 
83  memory = FT_FACE_MEMORY( face );
84 
85  FT_FREE( table );
86  }
87 
88 
89 /* END */
GLenum GLsizei GLenum GLenum const GLvoid * table
Definition: glew.h:4422
int FT_Error
Definition: fttypes.h:296
return FT_Err_Invalid_Argument
Definition: ftbbox.c:584
#define FT_FACE_FIND_GLOBAL_SERVICE(face, ptr, id)
Definition: ftserv.h:132
#define FT_FREE(ptr)
Definition: ftmemory.h:286
FT_Error error
Definition: cffdrivr.c:407
GLenum face
Definition: gl2ext.h:1490
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:529
#define FT_EXPORT_DEF(x)
Definition: ftconfig.h:511
unsigned int FT_UInt
Definition: fttypes.h:227
FT_OpenType_Free(FT_Face face, FT_Bytes table)
Definition: ftotval.c:74
FT_OpenType_Validate(FT_Face face, FT_UInt validation_flags, FT_Bytes *BASE_table, FT_Bytes *GDEF_table, FT_Bytes *GPOS_table, FT_Bytes *GSUB_table, FT_Bytes *JSTF_table)
Definition: ftotval.c:27