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]
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, 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 #include <ft2build.h>
19 #include FT_INTERNAL_DEBUG_H
20 
21 #include FT_INTERNAL_OBJECTS_H
22 #include FT_SERVICE_OPENTYPE_VALIDATE_H
23 #include FT_OPENTYPE_VALIDATE_H
24 
25 
26  /* documentation is in ftotval.h */
27 
30  FT_UInt validation_flags,
31  FT_Bytes *BASE_table,
32  FT_Bytes *GDEF_table,
33  FT_Bytes *GPOS_table,
34  FT_Bytes *GSUB_table,
35  FT_Bytes *JSTF_table )
36  {
37  FT_Service_OTvalidate service;
39 
40 
41  if ( !face )
42  {
43  error = FT_THROW( Invalid_Face_Handle );
44  goto Exit;
45  }
46 
47  if ( !( BASE_table &&
48  GDEF_table &&
49  GPOS_table &&
50  GSUB_table &&
51  JSTF_table ) )
52  {
53  error = FT_THROW( Invalid_Argument );
54  goto Exit;
55  }
56 
57  FT_FACE_FIND_GLOBAL_SERVICE( face, service, OPENTYPE_VALIDATE );
58 
59  if ( service )
60  error = service->validate( face,
61  validation_flags,
62  BASE_table,
63  GDEF_table,
64  GPOS_table,
65  GSUB_table,
66  JSTF_table );
67  else
68  error = FT_THROW( Unimplemented_Feature );
69 
70  Exit:
71  return error;
72  }
73 
74 
75  FT_EXPORT_DEF( void )
77  FT_Bytes table )
78  {
79  FT_Memory memory;
80 
81 
82  if ( !face )
83  return;
84 
85  memory = FT_FACE_MEMORY( face );
86 
87  FT_FREE( table );
88  }
89 
90 
91 /* END */
int FT_Error
Definition: fttypes.h:296
FT_OpenType_Free(FT_Face face, FT_Bytes table)
Definition: ftotval.c:76
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:29
return FT_THROW(Missing_Property)
#define FT_FACE_FIND_GLOBAL_SERVICE(face, ptr, id)
Definition: ftserv.h:133
GLenum GLuint GLint GLenum face
#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