1 /***************************************************************************/
5 /* OpenType 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 <cid/cidobjs.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 /* current :: The current glyph outline. */
56 /* base :: The base glyph outline. */
58 /* max_points :: maximum points in builder outline */
60 /* max_contours :: Maximal number of contours in builder outline. */
62 /* last :: The last point position. */
64 /* scale_x :: The horizontal scale (FUnits to sub-pixels). */
66 /* scale_y :: The vertical scale (FUnits to sub-pixels). */
68 /* pos_x :: The horizontal translation (if composite glyph). */
70 /* pos_y :: The vertical translation (if composite glyph). */
72 /* left_bearing :: The left side bearing point. */
74 /* advance :: The horizontal advance vector. */
78 /* path_begun :: A flag which indicates that a new path has begun. */
80 /* load_points :: If this flag is not set, no points are loaded. */
82 /* no_recurse :: Set but not used. */
84 /* error :: An error code that is only used to report memory */
85 /* allocation problems. */
87 /* metrics_only :: A boolean indicating that we only want to compute */
88 /* the metrics of a given glyph, not load all of its */
91 typedef struct CID_Builder_
96 FT_GlyphLoader
* loader
;
108 FT_Vector left_bearing
;
111 FT_BBox bbox
; /* bounding box */
116 FT_Error error
; /* only used for memory errors */
117 FT_Bool metrics_only
;
122 /* execution context charstring zone */
124 typedef struct CID_Decoder_Zone_
133 typedef struct CID_Decoder_
137 FT_Int stack
[T1_MAX_CHARSTRINGS_OPERANDS
];
140 CID_Decoder_Zone zones
[T1_MAX_SUBRS_CALLS
+ 1];
141 CID_Decoder_Zone
* zone
;
143 FT_Matrix font_matrix
;
148 FT_Int num_flex_vectors
;
149 FT_Vector flex_vectors
[7];
155 void CID_Init_Builder( CID_Builder
* builder
,
158 CID_GlyphSlot glyph
);
161 void CID_Done_Builder( CID_Builder
* builder
);
165 void CID_Init_Decoder( CID_Decoder
* decoder
);
170 /* Compute the maximum advance width of a font through quick parsing */
172 FT_Error
CID_Compute_Max_Advance( CID_Face face
,
173 FT_Int
* max_advance
);
177 /* This function is exported, because it is used by the T1Dump utility */
179 FT_Error
CID_Parse_CharStrings( CID_Decoder
* decoder
,
180 FT_Byte
* charstring_base
,
181 FT_Int charstring_len
);
184 FT_Error
CID_Load_Glyph( CID_GlyphSlot glyph
,
195 #endif /* CIDGLOAD_H */