zenilib  0.5.3.0
 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 
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  {
89 
92 
95 
96  FT_BBox bbox; /* bounding box */
100 
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  {
116 
118 
119 
120  typedef struct CFF_Decoder_
121  {
124 
127 
130 
134 
137 
142 
145 
148 
151 
152  FT_Byte** glyph_names; /* for pure CFF fonts only */
153  FT_UInt num_glyphs; /* number of glyphs in font */
154 
156 
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 )
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 )
186  FT_Byte* charstring_base,
187  FT_ULong charstring_len );
188 
189  FT_LOCAL( FT_Error )
191  CFF_Size size,
192  FT_UInt glyph_index,
193  FT_Int32 load_flags );
194 
195 
197 
198 #endif /* __CFFGLOAD_H__ */
199 
200 
201 /* END */
FT_BBox bbox
Definition: cffgload.h:96
int FT_Error
Definition: fttypes.h:296
FT_Outline * base
Definition: cffgload.h:87
FT_Bool metrics_only
Definition: cffgload.h:101
FT_GlyphLoader loader
Definition: cffgload.h:86
FT_Byte ** globals
Definition: cffgload.h:150
unsigned long FT_ULong
Definition: fttypes.h:249
FT_BEGIN_HEADER typedef signed long FT_Pos
Definition: ftimage.h:59
FT_Pos nominal_width
Definition: cffgload.h:136
#define CFF_MAX_TRANS_ELEMENTS
Definition: cffgload.h:33
#define FT_END_HEADER
Definition: ftheader.h:54
FT_UInt num_locals
Definition: cffgload.h:143
CFF_Builder builder
Definition: cffgload.h:122
#define CFF_MAX_SUBRS_CALLS
Definition: cffgload.h:32
signed int FT_Int
Definition: fttypes.h:216
enum FT_Render_Mode_ FT_Render_Mode
FT_Int num_hints
Definition: cffgload.h:140
FT_Fixed stack[CFF_MAX_OPERANDS+1]
Definition: cffgload.h:125
FT_Render_Mode hint_mode
Definition: cffgload.h:155
cff_decoder_parse_charstrings(CFF_Decoder *decoder, FT_Byte *charstring_base, FT_ULong charstring_len)
Definition: cffgload.c:883
FT_Byte * limit
Definition: cffgload.h:114
FT_BEGIN_HEADER typedef unsigned char FT_Bool
Definition: fttypes.h:104
FT_Int globals_bias
Definition: cffgload.h:147
CFF_Decoder_Zone * zone
Definition: cffgload.h:129
FT_Pos glyph_width
Definition: cffgload.h:135
FT_Byte * base
Definition: cffgload.h:113
typedefFT_BEGIN_HEADER struct FT_GlyphLoaderRec_ * FT_GlyphLoader
Definition: ftgloadr.h:43
unsigned char FT_Byte
Definition: fttypes.h:150
#define FT_BEGIN_HEADER
Definition: ftheader.h:36
FT_Byte ** glyph_names
Definition: cffgload.h:152
#define FT_LOCAL(x)
Definition: ftconfig.h:466
FT_Bool no_recurse
Definition: cffgload.h:99
FT_Byte ** locals
Definition: cffgload.h:149
FT_Vector left_bearing
Definition: cffgload.h:93
FT_Outline * current
Definition: cffgload.h:88
cff_decoder_prepare(CFF_Decoder *decoder, CFF_Size size, FT_UInt glyph_index)
Definition: cffgload.c:408
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
GLenum face
Definition: gl2ext.h:1490
CFF_Decoder_Zone zones[CFF_MAX_SUBRS_CALLS+1]
Definition: cffgload.h:128
FT_UInt num_globals
Definition: cffgload.h:144
#define CFF_MAX_OPERANDS
Definition: cffgload.h:31
struct CFF_Decoder_Zone_ CFF_Decoder_Zone
FT_Memory memory
Definition: cffgload.h:83
struct CFF_Builder_ CFF_Builder
FT_Int flex_state
Definition: cffgload.h:131
FT_Bool width_only
Definition: cffgload.h:139
FT_Vector flex_vectors[7]
Definition: cffgload.h:133
cff_slot_load(CFF_GlyphSlot glyph, CFF_Size size, FT_UInt glyph_index, FT_Int32 load_flags)
Definition: cffgload.c:2580
FT_Bool path_begun
Definition: cffgload.h:97
void * hints_globals
Definition: cffgload.h:104
struct CFF_Decoder_ CFF_Decoder
CFF_GlyphSlot glyph
Definition: cffgload.h:85
typedefFT_BEGIN_HEADER struct FT_MemoryRec_ * FT_Memory
Definition: ftsystem.h:66
FT_Pos pos_x
Definition: cffgload.h:90
FT_Fixed buildchar[CFF_MAX_TRANS_ELEMENTS]
Definition: cffgload.h:141
FT_UInt num_glyphs
Definition: cffgload.h:153
signed long FT_Fixed
Definition: fttypes.h:284
FT_Bool seac
Definition: cffgload.h:157
FT_Byte * cursor
Definition: cffgload.h:115
FT_Int num_flex_vectors
Definition: cffgload.h:132
unsigned int FT_UInt
Definition: fttypes.h:227
FT_Int locals_bias
Definition: cffgload.h:146
TT_Face face
Definition: cffgload.h:84
CFF_Font cff
Definition: cffgload.h:123
FT_Fixed * top
Definition: cffgload.h:126
FT_Bool read_width
Definition: cffgload.h:138
FT_Vector advance
Definition: cffgload.h:94
FT_Bool load_points
Definition: cffgload.h:98
FT_Pos pos_y
Definition: cffgload.h:91
void * hints_funcs
Definition: cffgload.h:103
GLsizei size
Definition: gl2ext.h:1467