1
/***************************************************************************/
5
/* OpenType Glyph Loader (specification). */
7
/* Copyright 1996-2001, 2002, 2003, 2004 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
35
/*************************************************************************/
41
/* A structure used during glyph loading to store its outline. */
44
/* memory :: The current memory object. */
46
/* face :: The current face object. */
48
/* glyph :: The current glyph slot. */
50
/* loader :: The current glyph loader. */
52
/* base :: The base glyph outline. */
54
/* current :: The current glyph outline. */
56
/* last :: The last point position. */
58
/* scale_x :: The horizontal scale (FUnits to sub-pixels). */
60
/* scale_y :: The vertical scale (FUnits to sub-pixels). */
62
/* pos_x :: The horizontal translation (if composite glyph). */
64
/* pos_y :: The vertical translation (if composite glyph). */
66
/* left_bearing :: The left side bearing point. */
68
/* advance :: The horizontal advance vector. */
72
/* path_begun :: A flag which indicates that a new path has begun. */
74
/* load_points :: If this flag is not set, no points are loaded. */
76
/* no_recurse :: Set but not used. */
78
/* metrics_only :: A boolean indicating that we only want to compute */
79
/* the metrics of a given glyph, not load all of its */
82
/* hints_funcs :: Auxiliary pointer for hinting. */
84
/* hints_globals :: Auxiliary pointer for hinting. */
86
typedef struct CFF_Builder_
91
FT_GlyphLoader loader;
103
FT_Vector left_bearing;
106
FT_BBox bbox; /* bounding box */
111
FT_Bool metrics_only;
113
void* hints_funcs; /* hinter-specific */
114
void* hints_globals; /* hinter-specific */
119
/* execution context charstring zone */
121
typedef struct CFF_Decoder_Zone_
130
typedef struct CFF_Decoder_
135
FT_Fixed stack[CFF_MAX_OPERANDS + 1];
138
CFF_Decoder_Zone zones[CFF_MAX_SUBRS_CALLS + 1];
139
CFF_Decoder_Zone* zone;
142
FT_Int num_flex_vectors;
143
FT_Vector flex_vectors[7];
146
FT_Pos nominal_width;
151
FT_Int len_buildchar;
162
FT_Byte** glyph_names; /* for pure CFF fonts only */
163
FT_UInt num_glyphs; /* number of glyphs in font */
165
FT_Render_Mode hint_mode;
171
cff_decoder_init( CFF_Decoder* decoder,
176
FT_Render_Mode hint_mode );
179
cff_decoder_prepare( CFF_Decoder* decoder,
180
FT_UInt glyph_index );
182
#if 0 /* unused until we support pure CFF fonts */
184
/* Compute the maximum advance width of a font through quick parsing */
186
cff_compute_max_advance( TT_Face face,
187
FT_Int* max_advance );
192
cff_decoder_parse_charstrings( CFF_Decoder* decoder,
193
FT_Byte* charstring_base,
194
FT_ULong charstring_len );
197
cff_slot_load( CFF_GlyphSlot glyph,
200
FT_Int32 load_flags );
205
#endif /* __CFFGLOAD_H__ */