ReactOS 0.4.16-dev-2354-g16de117
cffparse.h
Go to the documentation of this file.
1/****************************************************************************
2 *
3 * cffparse.h
4 *
5 * CFF token stream parser (specification)
6 *
7 * Copyright (C) 1996-2020 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
19#ifndef CFFPARSE_H_
20#define CFFPARSE_H_
21
22
25
26
28
29
30 /* CFF uses constant parser stack size; */
31 /* CFF2 can increase from default 193 */
32#define CFF_MAX_STACK_DEPTH 96
33
34 /*
35 * There are plans to remove the `maxstack' operator in a forthcoming
36 * revision of the CFF2 specification, increasing the (then static) stack
37 * size to 513. By making the default stack size equal to the maximum
38 * stack size, the operator is essentially disabled, which has the
39 * desired effect in FreeType.
40 */
41#define CFF2_MAX_STACK 513
42#define CFF2_DEFAULT_STACK 513
43
44#define CFF_CODE_TOPDICT 0x1000
45#define CFF_CODE_PRIVATE 0x2000
46#define CFF2_CODE_TOPDICT 0x3000
47#define CFF2_CODE_FONTDICT 0x4000
48#define CFF2_CODE_PRIVATE 0x5000
49
50
51 typedef struct CFF_ParserRec_
52 {
57
60 FT_UInt stackSize; /* allocated size */
61
62#ifdef CFF_CONFIG_OPTION_OLD_ENGINE
63 FT_ListRec t2_strings;
64#endif /* CFF_CONFIG_OPTION_OLD_ENGINE */
65
67 void* object;
68
69 FT_UShort num_designs; /* a copy of `CFF_FontRecDict->num_designs' */
70 FT_UShort num_axes; /* a copy of `CFF_FontRecDict->num_axes' */
71
73
74
77 FT_Byte** d );
78
82 void* object,
84 FT_UInt stackSize,
85 FT_UShort num_designs,
86 FT_UShort num_axes );
87
88 FT_LOCAL( void )
90
94 FT_Byte* limit );
95
96
97 enum
98 {
108
109 cff_kind_max /* do not remove */
110 };
111
112
113 /* now generate handlers for the most simple fields */
115
116 typedef struct CFF_Field_Handler_
117 {
118 int kind;
119 int code;
125
126#ifdef FT_DEBUG_LEVEL_TRACE
127 const char* id;
128#endif
129
131
132
134
135
136#ifdef CFF_CONFIG_OPTION_OLD_ENGINE
137 typedef struct CFF_T2_String_
138 {
139 FT_Byte* start;
140 FT_Byte* limit;
141
142 } CFF_T2_StringRec, *CFF_T2_String;
143#endif /* CFF_CONFIG_OPTION_OLD_ENGINE */
144
145#endif /* CFFPARSE_H_ */
146
147
148/* END */
FT_Library library
Definition: cffdrivr.c:660
cff_parser_init(CFF_Parser parser, FT_UInt code, void *object, FT_Library library, FT_UInt stackSize, FT_UShort num_designs, FT_UShort num_axes)
Definition: cffparse.c:41
cff_parse_num(CFF_Parser parser, FT_Byte **d)
Definition: cffparse.c:522
struct CFF_ParserRec_ * CFF_Parser
struct CFF_Field_Handler_ CFF_Field_Handler
cff_parser_done(CFF_Parser parser)
Definition: cffparse.c:97
struct CFF_ParserRec_ CFF_ParserRec
cff_parser_run(CFF_Parser parser, FT_Byte *start, FT_Byte *limit)
Definition: cffparse.c:1194
@ cff_kind_callback
Definition: cffparse.h:106
@ cff_kind_bool
Definition: cffparse.h:104
@ cff_kind_fixed_thousand
Definition: cffparse.h:102
@ cff_kind_fixed
Definition: cffparse.h:101
@ cff_kind_max
Definition: cffparse.h:109
@ cff_kind_delta
Definition: cffparse.h:105
@ cff_kind_blend
Definition: cffparse.h:107
@ cff_kind_none
Definition: cffparse.h:99
@ cff_kind_string
Definition: cffparse.h:103
@ cff_kind_num
Definition: cffparse.h:100
FT_Error(* CFF_Field_Reader)(CFF_Parser parser)
Definition: cffparse.h:114
#define FT_LOCAL(x)
#define FT_END_HEADER
Definition: ftheader.h:57
#define FT_BEGIN_HEADER
Definition: ftheader.h:37
unsigned char FT_Byte
Definition: fttypes.h:154
int FT_Error
Definition: fttypes.h:299
signed long FT_Long
Definition: fttypes.h:242
unsigned short FT_UShort
Definition: fttypes.h:209
unsigned int FT_UInt
Definition: fttypes.h:231
GLuint start
Definition: gl.h:1545
GLint limit
Definition: glext.h:10326
GLuint id
Definition: glext.h:5910
#define d
Definition: ke_i.h:81
FT_UInt count_offset
Definition: cffparse.h:124
CFF_Field_Reader reader
Definition: cffparse.h:122
FT_UInt array_max
Definition: cffparse.h:123
FT_Byte * limit
Definition: cffparse.h:55
FT_UShort num_designs
Definition: cffparse.h:69
void * object
Definition: cffparse.h:67
FT_Byte ** stack
Definition: cffparse.h:58
FT_Byte ** top
Definition: cffparse.h:59
FT_Byte * start
Definition: cffparse.h:54
FT_UInt object_code
Definition: cffparse.h:66
FT_UShort num_axes
Definition: cffparse.h:70
FT_UInt stackSize
Definition: cffparse.h:60
FT_Byte * cursor
Definition: cffparse.h:56
FT_Library library
Definition: cffparse.h:53
Definition: inflate.c:139
Definition: import.c:81