ReactOS 0.4.16-dev-981-g80eb313
ftgxval.c
Go to the documentation of this file.
1/****************************************************************************
2 *
3 * ftgxval.c
4 *
5 * FreeType API for validating TrueTypeGX/AAT tables (body).
6 *
7 * Copyright (C) 2004-2019 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 )
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 )
77 {
79
80
81 if ( !face )
82 return;
83
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 )
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 )
128 {
130
131
132 if ( !face )
133 return;
134
136
137
138 FT_FREE( table );
139 }
140
141
142/* END */
struct nls_table * tables
Definition: nls_base.c:22
#define FT_EXPORT_DEF(x)
Definition: ftconfig.h:494
#define FT_THROW(e)
Definition: ftdebug.h:241
FT_ClassicKern_Validate(FT_Face face, FT_UInt validation_flags, FT_Bytes *ckern_table)
Definition: ftgxval.c:91
FT_ClassicKern_Free(FT_Face face, FT_Bytes table)
Definition: ftgxval.c:126
FT_TrueTypeGX_Free(FT_Face face, FT_Bytes table)
Definition: ftgxval.c:75
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
#define FT_VALIDATE_GX_LENGTH
Definition: ftgxval.h:104
#define FT_FREE(ptr)
Definition: ftmemory.h:328
#define FT_FACE_MEMORY(x)
Definition: ftobjs.h:605
#define FT_FACE_FIND_GLOBAL_SERVICE(face, ptr, id)
Definition: ftserv.h:127
typedefFT_BEGIN_HEADER struct FT_MemoryRec_ * FT_Memory
Definition: ftsystem.h:65
int FT_Error
Definition: fttypes.h:299
unsigned int FT_UInt
Definition: fttypes.h:231
const FT_Byte * FT_Bytes
Definition: fttypes.h:165
GLenum GLuint GLint GLenum face
Definition: glext.h:7025
#define error(str)
Definition: mkdosfs.c:1605
static char memory[1024 *256]
Definition: process.c:116
static void Exit(void)
Definition: sock.c:1330