ReactOS
0.4.16-dev-329-g9223134
cffparse.h
Go to the documentation of this file.
1
/***************************************************************************/
2
/* */
3
/* cffparse.h */
4
/* */
5
/* CFF token stream parser (specification) */
6
/* */
7
/* Copyright 1996-2018 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
23
#include <ft2build.h>
24
#include FT_INTERNAL_CFF_TYPES_H
25
#include FT_INTERNAL_OBJECTS_H
26
27
28
FT_BEGIN_HEADER
29
30
31
/* CFF uses constant parser stack size; */
32
/* CFF2 can increase from default 193 */
33
#define CFF_MAX_STACK_DEPTH 96
34
35
/*
36
* There are plans to remove the `maxstack' operator in a forthcoming
37
* revision of the CFF2 specification, increasing the (then static) stack
38
* size to 513. By making the default stack size equal to the maximum
39
* stack size, the operator is essentially disabled, which has the
40
* desired effect in FreeType.
41
*/
42
#define CFF2_MAX_STACK 513
43
#define CFF2_DEFAULT_STACK 513
44
45
#define CFF_CODE_TOPDICT 0x1000
46
#define CFF_CODE_PRIVATE 0x2000
47
#define CFF2_CODE_TOPDICT 0x3000
48
#define CFF2_CODE_FONTDICT 0x4000
49
#define CFF2_CODE_PRIVATE 0x5000
50
51
52
typedef
struct
CFF_ParserRec_
53
{
54
FT_Library
library
;
55
FT_Byte
*
start
;
56
FT_Byte
*
limit
;
57
FT_Byte
*
cursor
;
58
59
FT_Byte
**
stack
;
60
FT_Byte
**
top
;
61
FT_UInt
stackSize
;
/* allocated size */
62
63
FT_UInt
object_code
;
64
void
*
object
;
65
66
FT_UShort
num_designs
;
/* a copy of `CFF_FontRecDict->num_designs' */
67
FT_UShort
num_axes
;
/* a copy of `CFF_FontRecDict->num_axes' */
68
69
}
CFF_ParserRec
, *
CFF_Parser
;
70
71
72
FT_LOCAL
(
FT_Long
)
73
cff_parse_num
(
CFF_Parser
parser
,
74
FT_Byte
**
d
);
75
76
FT_LOCAL
(
FT_Error
)
77
cff_parser_init
(
CFF_Parser
parser
,
78
FT_UInt
code
,
79
void
*
object
,
80
FT_Library
library
,
81
FT_UInt
stackSize,
82
FT_UShort
num_designs,
83
FT_UShort
num_axes );
84
85
FT_LOCAL
(
void
)
86
cff_parser_done
(
CFF_Parser
parser
);
87
88
FT_LOCAL
(
FT_Error
)
89
cff_parser_run
(
CFF_Parser
parser
,
90
FT_Byte
*
start
,
91
FT_Byte
*
limit
);
92
93
94
enum
95
{
96
cff_kind_none
= 0,
97
cff_kind_num
,
98
cff_kind_fixed
,
99
cff_kind_fixed_thousand
,
100
cff_kind_string
,
101
cff_kind_bool
,
102
cff_kind_delta
,
103
cff_kind_callback
,
104
cff_kind_blend
,
105
106
cff_kind_max
/* do not remove */
107
};
108
109
110
/* now generate handlers for the most simple fields */
111
typedef
FT_Error
(*
CFF_Field_Reader
)(
CFF_Parser
parser
);
112
113
typedef
struct
CFF_Field_Handler_
114
{
115
int
kind
;
116
int
code
;
117
FT_UInt
offset
;
118
FT_Byte
size
;
119
CFF_Field_Reader
reader
;
120
FT_UInt
array_max
;
121
FT_UInt
count_offset
;
122
123
#ifdef FT_DEBUG_LEVEL_TRACE
124
const
char
*
id
;
125
#endif
126
127
}
CFF_Field_Handler
;
128
129
130
FT_END_HEADER
131
132
133
#endif
/* CFFPARSE_H_ */
134
135
136
/* END */
library
FT_Library library
Definition:
cffdrivr.c:654
cff_parser_init
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:42
cff_parse_num
cff_parse_num(CFF_Parser parser, FT_Byte **d)
Definition:
cffparse.c:454
CFF_Parser
struct CFF_ParserRec_ * CFF_Parser
CFF_Field_Handler
struct CFF_Field_Handler_ CFF_Field_Handler
cff_parser_done
cff_parser_done(CFF_Parser parser)
Definition:
cffparse.c:81
CFF_ParserRec
struct CFF_ParserRec_ CFF_ParserRec
cff_parser_run
cff_parser_run(CFF_Parser parser, FT_Byte *start, FT_Byte *limit)
Definition:
cffparse.c:1300
cff_kind_callback
@ cff_kind_callback
Definition:
cffparse.h:103
cff_kind_bool
@ cff_kind_bool
Definition:
cffparse.h:101
cff_kind_fixed_thousand
@ cff_kind_fixed_thousand
Definition:
cffparse.h:99
cff_kind_fixed
@ cff_kind_fixed
Definition:
cffparse.h:98
cff_kind_max
@ cff_kind_max
Definition:
cffparse.h:106
cff_kind_delta
@ cff_kind_delta
Definition:
cffparse.h:102
cff_kind_blend
@ cff_kind_blend
Definition:
cffparse.h:104
cff_kind_none
@ cff_kind_none
Definition:
cffparse.h:96
cff_kind_string
@ cff_kind_string
Definition:
cffparse.h:100
cff_kind_num
@ cff_kind_num
Definition:
cffparse.h:97
CFF_Field_Reader
FT_Error(* CFF_Field_Reader)(CFF_Parser parser)
Definition:
cffparse.h:111
FT_LOCAL
#define FT_LOCAL(x)
Definition:
ftconfig.h:387
FT_END_HEADER
#define FT_END_HEADER
Definition:
ftheader.h:54
FT_BEGIN_HEADER
#define FT_BEGIN_HEADER
Definition:
ftheader.h:36
FT_Byte
unsigned char FT_Byte
Definition:
fttypes.h:154
FT_Error
int FT_Error
Definition:
fttypes.h:300
FT_Long
signed long FT_Long
Definition:
fttypes.h:242
FT_UShort
unsigned short FT_UShort
Definition:
fttypes.h:209
FT_UInt
unsigned int FT_UInt
Definition:
fttypes.h:231
start
GLuint start
Definition:
gl.h:1545
limit
GLint limit
Definition:
glext.h:10326
id
GLuint id
Definition:
glext.h:5910
d
#define d
Definition:
ke_i.h:81
CFF_Field_Handler_
Definition:
cffparse.h:114
CFF_Field_Handler_::offset
FT_UInt offset
Definition:
cffparse.h:117
CFF_Field_Handler_::kind
int kind
Definition:
cffparse.h:115
CFF_Field_Handler_::count_offset
FT_UInt count_offset
Definition:
cffparse.h:121
CFF_Field_Handler_::code
int code
Definition:
cffparse.h:116
CFF_Field_Handler_::size
FT_Byte size
Definition:
cffparse.h:118
CFF_Field_Handler_::reader
CFF_Field_Reader reader
Definition:
cffparse.h:119
CFF_Field_Handler_::array_max
FT_UInt array_max
Definition:
cffparse.h:120
CFF_ParserRec_
Definition:
cffparse.h:53
CFF_ParserRec_::limit
FT_Byte * limit
Definition:
cffparse.h:56
CFF_ParserRec_::num_designs
FT_UShort num_designs
Definition:
cffparse.h:66
CFF_ParserRec_::object
void * object
Definition:
cffparse.h:64
CFF_ParserRec_::stack
FT_Byte ** stack
Definition:
cffparse.h:59
CFF_ParserRec_::top
FT_Byte ** top
Definition:
cffparse.h:60
CFF_ParserRec_::start
FT_Byte * start
Definition:
cffparse.h:55
CFF_ParserRec_::object_code
FT_UInt object_code
Definition:
cffparse.h:63
CFF_ParserRec_::num_axes
FT_UShort num_axes
Definition:
cffparse.h:67
CFF_ParserRec_::stackSize
FT_UInt stackSize
Definition:
cffparse.h:61
CFF_ParserRec_::cursor
FT_Byte * cursor
Definition:
cffparse.h:57
CFF_ParserRec_::library
FT_Library library
Definition:
cffparse.h:54
FT_LibraryRec_
Definition:
ftobjs.h:917
code
Definition:
inflate.c:139
parser
Definition:
import.c:81
sdk
lib
3rdparty
freetype
src
cff
cffparse.h
Generated on Sat Dec 7 2024 06:12:56 for ReactOS by
1.9.6