1
/***************************************************************************/
5
/* OpenType Glyph Loader (specification). */
7
/* Copyright 1996-2001, 2002, 2003, 2004, 2006, 2007, 2008, 2009 by */
8
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
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. */
16
/***************************************************************************/
19
#ifndef __CFFGLOAD_H__
20
#define __CFFGLOAD_H__
24
#include FT_FREETYPE_H
31
#define CFF_MAX_OPERANDS 48
32
#define CFF_MAX_SUBRS_CALLS 32
33
#define CFF_MAX_TRANS_ELEMENTS 32
36
/*************************************************************************/
42
/* A structure used during glyph loading to store its outline. */
45
/* memory :: The current memory object. */
47
/* face :: The current face object. */
49
/* glyph :: The current glyph slot. */
51
/* loader :: The current glyph loader. */
53
/* base :: The base glyph outline. */
55
/* current :: The current glyph outline. */
57
/* pos_x :: The horizontal translation (if composite glyph). */
59
/* pos_y :: The vertical translation (if composite glyph). */
61
/* left_bearing :: The left side bearing point. */
63
/* advance :: The horizontal advance vector. */
67
/* path_begun :: A flag which indicates that a new path has begun. */
69
/* load_points :: If this flag is not set, no points are loaded. */
71
/* no_recurse :: Set but not used. */
73
/* metrics_only :: A boolean indicating that we only want to compute */
74
/* the metrics of a given glyph, not load all of its */
77
/* hints_funcs :: Auxiliary pointer for hinting. */
79
/* hints_globals :: Auxiliary pointer for hinting. */
81
typedef struct CFF_Builder_
86
FT_GlyphLoader loader;
93
FT_Vector left_bearing;
96
FT_BBox bbox; /* bounding box */
101
FT_Bool metrics_only;
103
void* hints_funcs; /* hinter-specific */
104
void* hints_globals; /* hinter-specific */
109
/* execution context charstring zone */
111
typedef struct CFF_Decoder_Zone_
120
typedef struct CFF_Decoder_
125
FT_Fixed stack[CFF_MAX_OPERANDS + 1];
128
CFF_Decoder_Zone zones[CFF_MAX_SUBRS_CALLS + 1];
129
CFF_Decoder_Zone* zone;
132
FT_Int num_flex_vectors;
133
FT_Vector flex_vectors[7];
136
FT_Pos nominal_width;
141
FT_Fixed buildchar[CFF_MAX_TRANS_ELEMENTS];
152
FT_Byte** glyph_names; /* for pure CFF fonts only */
153
FT_UInt num_glyphs; /* number of glyphs in font */
155
FT_Render_Mode hint_mode;
163
cff_decoder_init( CFF_Decoder* decoder,
168
FT_Render_Mode hint_mode );
171
cff_decoder_prepare( CFF_Decoder* decoder,
173
FT_UInt glyph_index );
175
#if 0 /* unused until we support pure CFF fonts */
177
/* Compute the maximum advance width of a font through quick parsing */
179
cff_compute_max_advance( TT_Face face,
180
FT_Int* max_advance );
185
cff_decoder_parse_charstrings( CFF_Decoder* decoder,
186
FT_Byte* charstring_base,
187
FT_ULong charstring_len );
190
cff_slot_load( CFF_GlyphSlot glyph,
193
FT_Int32 load_flags );
198
#endif /* __CFFGLOAD_H__ */