1 /***************************************************************************/
5 /* Experimental Type 1 Glyph Loader (specification). */
7 /* Copyright 1996-2000 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 /***************************************************************************/
23 #ifdef FT_FLAT_COMPILE
29 #include <type1z/z1objs.h>
39 /*************************************************************************/
45 /* A structure used during glyph loading to store its outline. */
48 /* memory :: The current memory object. */
50 /* face :: The current face object. */
52 /* glyph :: The current glyph slot. */
54 /* loader :: The current glyph loader. */
56 /* current :: The current glyph outline. */
58 /* base :: The base glyph outline. */
60 /* last :: The last point position. */
62 /* scale_x :: The horizontal scale (FUnits to sub-pixels). */
64 /* scale_y :: The vertical scale (FUnits to sub-pixels). */
66 /* pos_x :: The horizontal translation (for composite glyphs). */
68 /* pos_y :: The vertical translation (for composite glyphs). */
70 /* left_bearing :: The left side bearing point. */
72 /* advance :: The horizontal advance vector. */
76 /* bbox :: The glyph's bounding box. */
78 /* path_begun :: A flag which indicates that a new path has begun. */
80 /* load_points :: A flag which indicates, if not set, that no points */
83 /* error :: The current error code. */
85 /* metrics_only :: A flag whether to compute metrics only. */
87 typedef struct Z1_Builder_
92 FT_GlyphLoader
* loader
;
94 FT_Outline
* current
; /* the current glyph outline */
95 FT_Outline
* base
; /* the composite glyph outline */
105 FT_Vector left_bearing
;
108 FT_BBox bbox
; /* bounding box */
113 FT_Error error
; /* only used for memory errors */
114 FT_Bool metrics_only
;
119 /* execution context charstring zone */
120 typedef struct Z1_Decoder_Zone_
129 typedef struct Z1_Decoder_
133 FT_Int stack
[T1_MAX_CHARSTRINGS_OPERANDS
];
136 Z1_Decoder_Zone zones
[T1_MAX_SUBRS_CALLS
+ 1];
137 Z1_Decoder_Zone
* zone
;
140 FT_Int num_flex_vectors
;
141 FT_Vector flex_vectors
[7];
143 T1_Blend
* blend
; /* for multiple masters */
149 void Z1_Init_Builder( Z1_Builder
* builder
,
152 Z1_GlyphSlot glyph
);
155 void Z1_Done_Builder( Z1_Builder
* builder
);
158 void Z1_Init_Decoder( Z1_Decoder
* decoder
);
161 FT_Error
Z1_Compute_Max_Advance( T1_Face face
,
162 FT_Int
* max_advance
);
165 FT_Error
Z1_Parse_CharStrings( Z1_Decoder
* decoder
,
166 FT_Byte
* charstring_base
,
167 FT_Int charstring_len
,
169 FT_Byte
** subrs_base
,
173 FT_Error
Z1_Load_Glyph( Z1_GlyphSlot glyph
,
184 #endif /* Z1GLOAD_H */