zenilib: zenilib/jni/external/freetype2/src/cff/cffgload.h Source File

zenilib 0.5.3.0

- Main Page
- Modules
- Namespaces
- Classes
- Files

- File List
- File Members

All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
cffgload.h
Go to the documentation of this file.
1 /***************************************************************************/
2 /* */
3 /* cffgload.h */
4 /* */
5 /* OpenType Glyph Loader (specification). */
6 /* */
7 /* Copyright 1996-2001, 2002, 2003, 2004, 2006, 2007, 2008, 2009 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 __CFFGLOAD_H__
20 #define __CFFGLOAD_H__
21
22
23 #include <ft2build.h>
24 #include FT_FREETYPE_H
25 #include "cffobjs.h"
26
27
28 FT_BEGIN_HEADER
29
30
31 #define CFF_MAX_OPERANDS 48
32 #define CFF_MAX_SUBRS_CALLS 32
33 #define CFF_MAX_TRANS_ELEMENTS 32
34
35
36 /*************************************************************************/
37 /* */
38 /* <Structure> */
39 /* CFF_Builder */
40 /* */
41 /* <Description> */
42 /* A structure used during glyph loading to store its outline. */
43 /* */
44 /* <Fields> */
45 /* memory :: The current memory object. */
46 /* */
47 /* face :: The current face object. */
48 /* */
49 /* glyph :: The current glyph slot. */
50 /* */
51 /* loader :: The current glyph loader. */
52 /* */
53 /* base :: The base glyph outline. */
54 /* */
55 /* current :: The current glyph outline. */
56 /* */
57 /* pos_x :: The horizontal translation (if composite glyph). */
58 /* */
59 /* pos_y :: The vertical translation (if composite glyph). */
60 /* */
61 /* left_bearing :: The left side bearing point. */
62 /* */
63 /* advance :: The horizontal advance vector. */
64 /* */
65 /* bbox :: Unused. */
66 /* */
67 /* path_begun :: A flag which indicates that a new path has begun. */
68 /* */
69 /* load_points :: If this flag is not set, no points are loaded. */
70 /* */
71 /* no_recurse :: Set but not used. */
72 /* */
73 /* metrics_only :: A boolean indicating that we only want to compute */
74 /* the metrics of a given glyph, not load all of its */
75 /* points. */
76 /* */
77 /* hints_funcs :: Auxiliary pointer for hinting. */
78 /* */
79 /* hints_globals :: Auxiliary pointer for hinting. */
80 /* */
81 typedef struct CFF_Builder_
82 {
83 FT_Memory memory;
84 TT_Face face;
85 CFF_GlyphSlot glyph;
86 FT_GlyphLoader loader;
87 FT_Outline* base;
88 FT_Outline* current;
89
90 FT_Pos pos_x;
91 FT_Pos pos_y;
92
93 FT_Vector left_bearing;
94 FT_Vector advance;
95
96 FT_BBox bbox; /* bounding box */
97 FT_Bool path_begun;
98 FT_Bool load_points;
99 FT_Bool no_recurse;
100
101 FT_Bool metrics_only;
102
103 void* hints_funcs; /* hinter-specific */
104 void* hints_globals; /* hinter-specific */
105
106 } CFF_Builder;
107
108
109 /* execution context charstring zone */
110
111 typedef struct CFF_Decoder_Zone_
112 {
113 FT_Byte* base;
114 FT_Byte* limit;
115 FT_Byte* cursor;
116
117 } CFF_Decoder_Zone;
118
119
120 typedef struct CFF_Decoder_
121 {
122 CFF_Builder builder;
123 CFF_Font cff;
124
125 FT_Fixed stack[CFF_MAX_OPERANDS + 1];
126 FT_Fixed* top;
127
128 CFF_Decoder_Zone zones[CFF_MAX_SUBRS_CALLS + 1];
129 CFF_Decoder_Zone* zone;
130
131 FT_Int flex_state;
132 FT_Int num_flex_vectors;
133 FT_Vector flex_vectors[7];
134
135 FT_Pos glyph_width;
136 FT_Pos nominal_width;
137
138 FT_Bool read_width;
139 FT_Bool width_only;
140 FT_Int num_hints;
141 FT_Fixed buildchar[CFF_MAX_TRANS_ELEMENTS];
142
143 FT_UInt num_locals;
144 FT_UInt num_globals;
145
146 FT_Int locals_bias;
147 FT_Int globals_bias;
148
149 FT_Byte** locals;
150 FT_Byte** globals;
151
152 FT_Byte** glyph_names; /* for pure CFF fonts only */
153 FT_UInt num_glyphs; /* number of glyphs in font */
154
155 FT_Render_Mode hint_mode;
156
157 FT_Bool seac;
158
159 } CFF_Decoder;
160
161
162 FT_LOCAL( void )
163 cff_decoder_init( CFF_Decoder* decoder,
164 TT_Face face,
165 CFF_Size size,
166 CFF_GlyphSlot slot,
167 FT_Bool hinting,
168 FT_Render_Mode hint_mode );
169
170 FT_LOCAL( FT_Error )
171 cff_decoder_prepare( CFF_Decoder* decoder,
172 CFF_Size size,
173 FT_UInt glyph_index );
174
175 #if 0 /* unused until we support pure CFF fonts */
176
177 /* Compute the maximum advance width of a font through quick parsing */
178 FT_LOCAL( FT_Error )
179 cff_compute_max_advance( TT_Face face,
180 FT_Int* max_advance );
181
182 #endif /* 0 */
183
184 FT_LOCAL( FT_Error )
185 cff_decoder_parse_charstrings( CFF_Decoder* decoder,
186 FT_Byte* charstring_base,
187 FT_ULong charstring_len );
188
189 FT_LOCAL( FT_Error )
190 cff_slot_load( CFF_GlyphSlot glyph,
191 CFF_Size size,
192 FT_UInt glyph_index,
193 FT_Int32 load_flags );
194
195
196 FT_END_HEADER
197
198 #endif /* __CFFGLOAD_H__ */
199
200
201 /* END */
CFF_Builder_::bbox
FT_BBox bbox
Definition: cffgload.h:96
FT_Error
int FT_Error
Definition: fttypes.h:296
CFF_Builder_::base
FT_Outline * base
Definition: cffgload.h:87
CFF_Builder_::metrics_only
FT_Bool metrics_only
Definition: cffgload.h:101
CFF_Builder_::loader
FT_GlyphLoader loader
Definition: cffgload.h:86
CFF_Decoder_::globals
FT_Byte ** globals
Definition: cffgload.h:150
CFF_Decoder_
Definition: cffgload.h:120
FT_ULong
unsigned long FT_ULong
Definition: fttypes.h:249
FT_Pos
FT_BEGIN_HEADER typedef signed long FT_Pos
Definition: ftimage.h:59
CFF_Decoder_::nominal_width
FT_Pos nominal_width
Definition: cffgload.h:136
CFF_MAX_TRANS_ELEMENTS
#define CFF_MAX_TRANS_ELEMENTS
Definition: cffgload.h:33
FT_END_HEADER
#define FT_END_HEADER
Definition: ftheader.h:54
CFF_Decoder_::num_locals
FT_UInt num_locals
Definition: cffgload.h:143
CFF_Builder_
Definition: cffgload.h:81
CFF_Decoder_::builder
CFF_Builder builder
Definition: cffgload.h:122
CFF_MAX_SUBRS_CALLS
#define CFF_MAX_SUBRS_CALLS
Definition: cffgload.h:32
FT_Int
signed int FT_Int
Definition: fttypes.h:216
FT_Render_Mode
enum FT_Render_Mode_ FT_Render_Mode
CFF_Decoder_::num_hints
FT_Int num_hints
Definition: cffgload.h:140
CFF_Decoder_::stack
FT_Fixed stack[CFF_MAX_OPERANDS+1]
Definition: cffgload.h:125
FT_Outline_
Definition: ftimage.h:383
CFF_Decoder_::hint_mode
FT_Render_Mode hint_mode
Definition: cffgload.h:155
cff_decoder_parse_charstrings
cff_decoder_parse_charstrings(CFF_Decoder *decoder, FT_Byte *charstring_base, FT_ULong charstring_len)
Definition: cffgload.c:883
CFF_Decoder_Zone_::limit
FT_Byte * limit
Definition: cffgload.h:114
FT_Bool
FT_BEGIN_HEADER typedef unsigned char FT_Bool
Definition: fttypes.h:104
CFF_Decoder_::globals_bias
FT_Int globals_bias
Definition: cffgload.h:147
CFF_Decoder_::zone
CFF_Decoder_Zone * zone
Definition: cffgload.h:129
CFF_Decoder_::glyph_width
FT_Pos glyph_width
Definition: cffgload.h:135
CFF_Decoder_Zone_::base
FT_Byte * base
Definition: cffgload.h:113
FT_GlyphLoader
typedefFT_BEGIN_HEADER struct FT_GlyphLoaderRec_ * FT_GlyphLoader
Definition: ftgloadr.h:43
CFF_FontRec_
Definition: cfftypes.h:219
CFF_GlyphSlotRec_
Definition: cffobjs.h:71
FT_Byte
unsigned char FT_Byte
Definition: fttypes.h:150
FT_BEGIN_HEADER
#define FT_BEGIN_HEADER
Definition: ftheader.h:36
CFF_Decoder_::glyph_names
FT_Byte ** glyph_names
Definition: cffgload.h:152
FT_LOCAL
#define FT_LOCAL(x)
Definition: ftconfig.h:466
CFF_Builder_::no_recurse
FT_Bool no_recurse
Definition: cffgload.h:99
CFF_Decoder_::locals
FT_Byte ** locals
Definition: cffgload.h:149
CFF_Builder_::left_bearing
FT_Vector left_bearing
Definition: cffgload.h:93
CFF_Builder_::current
FT_Outline * current
Definition: cffgload.h:88
cff_decoder_prepare
cff_decoder_prepare(CFF_Decoder *decoder, CFF_Size size, FT_UInt glyph_index)
Definition: cffgload.c:408
cff_decoder_init
cff_decoder_init(CFF_Decoder *decoder, TT_Face face, CFF_Size size, CFF_GlyphSlot slot, FT_Bool hinting, FT_Render_Mode hint_mode)
Definition: cffgload.c:377
face
GLenum face
Definition: gl2ext.h:1490
CFF_Decoder_::zones
CFF_Decoder_Zone zones[CFF_MAX_SUBRS_CALLS+1]
Definition: cffgload.h:128
CFF_Decoder_::num_globals
FT_UInt num_globals
Definition: cffgload.h:144
CFF_MAX_OPERANDS
#define CFF_MAX_OPERANDS
Definition: cffgload.h:31
CFF_Decoder_Zone
struct CFF_Decoder_Zone_ CFF_Decoder_Zone
CFF_Builder_::memory
FT_Memory memory
Definition: cffgload.h:83
FT_Vector_
Definition: ftimage.h:75
CFF_Builder
struct CFF_Builder_ CFF_Builder
CFF_Decoder_::flex_state
FT_Int flex_state
Definition: cffgload.h:131
CFF_Decoder_::width_only
FT_Bool width_only
Definition: cffgload.h:139
CFF_Decoder_::flex_vectors
FT_Vector flex_vectors[7]
Definition: cffgload.h:133
cff_slot_load
cff_slot_load(CFF_GlyphSlot glyph, CFF_Size size, FT_UInt glyph_index, FT_Int32 load_flags)
Definition: cffgload.c:2580
CFF_Builder_::path_begun
FT_Bool path_begun
Definition: cffgload.h:97
CFF_Builder_::hints_globals
void * hints_globals
Definition: cffgload.h:104
CFF_Decoder
struct CFF_Decoder_ CFF_Decoder
CFF_Builder_::glyph
CFF_GlyphSlot glyph
Definition: cffgload.h:85
FT_Memory
typedefFT_BEGIN_HEADER struct FT_MemoryRec_ * FT_Memory
Definition: ftsystem.h:66
CFF_Builder_::pos_x
FT_Pos pos_x
Definition: cffgload.h:90
CFF_Decoder_::buildchar
FT_Fixed buildchar[CFF_MAX_TRANS_ELEMENTS]
Definition: cffgload.h:141
CFF_Decoder_::num_glyphs
FT_UInt num_glyphs
Definition: cffgload.h:153
CFF_Decoder_Zone_
Definition: cffgload.h:111
ft2build.h
FT_Fixed
signed long FT_Fixed
Definition: fttypes.h:284
CFF_Decoder_::seac
FT_Bool seac
Definition: cffgload.h:157
CFF_Decoder_Zone_::cursor
FT_Byte * cursor
Definition: cffgload.h:115
CFF_Decoder_::num_flex_vectors
FT_Int num_flex_vectors
Definition: cffgload.h:132
FT_UInt
unsigned int FT_UInt
Definition: fttypes.h:227
CFF_Decoder_::locals_bias
FT_Int locals_bias
Definition: cffgload.h:146
cffobjs.h
CFF_Builder_::face
TT_Face face
Definition: cffgload.h:84
CFF_Decoder_::cff
CFF_Font cff
Definition: cffgload.h:123
CFF_Decoder_::top
FT_Fixed * top
Definition: cffgload.h:126
CFF_Decoder_::read_width
FT_Bool read_width
Definition: cffgload.h:138
CFF_Builder_::advance
FT_Vector advance
Definition: cffgload.h:94
FT_BBox_
Definition: ftimage.h:116
TT_FaceRec_
Definition: tttypes.h:1258
CFF_Builder_::load_points
FT_Bool load_points
Definition: cffgload.h:98
CFF_Builder_::pos_y
FT_Pos pos_y
Definition: cffgload.h:91
CFF_SizeRec_
Definition: cffobjs.h:55
CFF_Builder_::hints_funcs
void * hints_funcs
Definition: cffgload.h:103
size
GLsizei size
Definition: gl2ext.h:1467