Visualization Library 2.0.0-b5

A lightweight C++ OpenGL middleware for 2D/3D graphics

VL     Star     Watch     Fork     Issue

[Download] [Tutorials] [All Classes] [Grouped Classes]
cffgload.h
Go to the documentation of this file.
1 /***************************************************************************/
2 /* */
3 /* cffgload.h */
4 /* */
5 /* OpenType Glyph Loader (specification). */
6 /* */
7 /* Copyright 1996-2004, 2006-2009, 2013 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  FT_LOCAL( FT_Error )
110  cff_check_points( CFF_Builder* builder,
111  FT_Int count );
112 
113  FT_LOCAL( void )
115  FT_Pos x,
116  FT_Pos y,
117  FT_Byte flag );
118  FT_LOCAL( FT_Error )
120  FT_Pos x,
121  FT_Pos y );
122  FT_LOCAL( FT_Error )
124  FT_Pos x,
125  FT_Pos y );
126  FT_LOCAL( void )
128 
129 
130  FT_LOCAL( FT_Int )
132  FT_Int charcode );
133  FT_LOCAL( FT_Error )
135  FT_UInt glyph_index,
136  FT_Byte** pointer,
137  FT_ULong* length );
138  FT_LOCAL( void )
140  FT_Byte** pointer,
141  FT_ULong length );
142 
143 
144  /* execution context charstring zone */
145 
146  typedef struct CFF_Decoder_Zone_
147  {
151 
153 
154 
155  typedef struct CFF_Decoder_
156  {
159 
162 
165 
168  FT_Vector flex_vectors[7];
169 
172 
177 
180 
183 
186 
187  FT_Byte** glyph_names; /* for pure CFF fonts only */
188  FT_UInt num_glyphs; /* number of glyphs in font */
189 
191 
193 
194  CFF_SubFont current_subfont; /* for current glyph_index */
195 
196  } CFF_Decoder;
197 
198 
199  FT_LOCAL( void )
200  cff_decoder_init( CFF_Decoder* decoder,
201  TT_Face face,
202  CFF_Size size,
203  CFF_GlyphSlot slot,
204  FT_Bool hinting,
205  FT_Render_Mode hint_mode );
206 
207  FT_LOCAL( FT_Error )
209  CFF_Size size,
210  FT_UInt glyph_index );
211 
212 #if 0 /* unused until we support pure CFF fonts */
213 
214  /* Compute the maximum advance width of a font through quick parsing */
215  FT_LOCAL( FT_Error )
216  cff_compute_max_advance( TT_Face face,
217  FT_Int* max_advance );
218 
219 #endif /* 0 */
220 
221  FT_LOCAL( FT_Error )
223  FT_Byte* charstring_base,
224  FT_ULong charstring_len );
225 
226  FT_LOCAL( FT_Error )
228  CFF_Size size,
229  FT_UInt glyph_index,
230  FT_Int32 load_flags );
231 
232 
234 
235 #endif /* __CFFGLOAD_H__ */
236 
237 
238 /* END */
GLenum GLuint GLenum GLsizei length
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:185
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:171
#define CFF_MAX_TRANS_ELEMENTS
Definition: cffgload.h:33
#define FT_END_HEADER
Definition: ftheader.h:54
FT_UInt num_locals
Definition: cffgload.h:178
CFF_Builder builder
Definition: cffgload.h:157
#define CFF_MAX_SUBRS_CALLS
Definition: cffgload.h:32
GLint GLint GLint GLint GLint GLint y
signed int FT_Int
Definition: fttypes.h:216
GLsizei const GLvoid * pointer
enum FT_Render_Mode_ FT_Render_Mode
FT_Int num_hints
Definition: cffgload.h:175
GLint GLint GLint GLint GLint x
FT_Render_Mode hint_mode
Definition: cffgload.h:190
FT_Byte * limit
Definition: cffgload.h:149
FT_BEGIN_HEADER typedef unsigned char FT_Bool
Definition: fttypes.h:104
FT_Int globals_bias
Definition: cffgload.h:182
CFF_Decoder_Zone * zone
Definition: cffgload.h:164
GLenum GLuint GLint GLenum face
FT_Pos glyph_width
Definition: cffgload.h:170
FT_Byte * base
Definition: cffgload.h:148
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:187
FT_Bool no_recurse
Definition: cffgload.h:99
cff_builder_add_point1(CFF_Builder *builder, FT_Pos x, FT_Pos y)
Definition: cffgload.c:514
FT_Byte ** locals
Definition: cffgload.h:184
FT_Vector left_bearing
Definition: cffgload.h:93
FT_Outline * current
Definition: cffgload.h:88
cff_builder_close_contour(CFF_Builder *builder)
Definition: cffgload.c:581
CFF_Font cff
Definition: cffdrivr.c:454
#define FT_LOCAL(x)
Definition: ftconfig.h:235
FT_UInt num_globals
Definition: cffgload.h:179
signed int FT_Int32
Definition: ftconfig.h:132
cff_builder_start_point(CFF_Builder *builder, FT_Pos x, FT_Pos y)
Definition: cffgload.c:559
#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:166
FT_Bool width_only
Definition: cffgload.h:174
cff_lookup_glyph_by_stdcharcode(CFF_Font cff, FT_Int charcode)
Definition: cffgload.c:626
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
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:379
cff_free_glyph_data(TT_Face face, FT_Byte **pointer, FT_ULong length)
Definition: cffgload.c:691
FT_UInt num_glyphs
Definition: cffgload.h:188
signed long FT_Fixed
Definition: fttypes.h:284
FT_Bool seac
Definition: cffgload.h:192
FT_Byte * cursor
Definition: cffgload.h:150
FT_Int num_flex_vectors
Definition: cffgload.h:167
unsigned int FT_UInt
Definition: fttypes.h:227
FT_Int locals_bias
Definition: cffgload.h:181
TT_Face face
Definition: cffgload.h:84
cff_decoder_prepare(CFF_Decoder *decoder, CFF_Size size, FT_UInt glyph_index)
Definition: cffgload.c:410
CFF_Font cff
Definition: cffgload.h:158
GLuint GLuint GLsizei count
FT_Fixed * top
Definition: cffgload.h:161
cff_slot_load(CFF_GlyphSlot glyph, CFF_Size size, FT_UInt glyph_index, FT_Int32 load_flags)
Definition: cffgload.c:2598
cff_get_glyph_data(TT_Face face, FT_UInt glyph_index, FT_Byte **pointer, FT_ULong *length)
Definition: cffgload.c:655
FT_Bool read_width
Definition: cffgload.h:173
cff_decoder_parse_charstrings(CFF_Decoder *decoder, FT_Byte *charstring_base, FT_ULong charstring_len)
Definition: cffgload.c:898
FT_Vector advance
Definition: cffgload.h:94
cff_check_points(CFF_Builder *builder, FT_Int count)
Definition: cffgload.c:469
png_infop png_uint_32 flag
Definition: png.h:2005
FT_Bool load_points
Definition: cffgload.h:98
GLsizeiptr size
cff_builder_add_point(CFF_Builder *builder, FT_Pos x, FT_Pos y, FT_Byte flag)
Definition: cffgload.c:478
CFF_SubFont current_subfont
Definition: cffgload.h:194
FT_Pos pos_y
Definition: cffgload.h:91
void * hints_funcs
Definition: cffgload.h:103