1 /***************************************************************************/
5 /* Type 1 parser (specification). */
7 /* Copyright 1996-2001 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 /***************************************************************************/
24 #include FT_INTERNAL_TYPE1_TYPES_H
25 #include FT_INTERNAL_STREAM_H
31 /*************************************************************************/
37 /* A T1_ParserRec is an object used to parse a Type 1 fonts very */
41 /* root :: The root parser. */
43 /* stream :: The current input stream. */
45 /* base_dict :: A pointer to the top-level dictionary. */
47 /* base_len :: The length in bytes of the top dictionary. */
49 /* private_dict :: A pointer to the private dictionary. */
51 /* private_len :: The length in bytes of the private dictionary. */
53 /* in_pfb :: A boolean. Indicates that we are handling a PFB */
56 /* in_memory :: A boolean. Indicates a memory-based stream. */
58 /* single_block :: A boolean. Indicates that the private dictionary */
59 /* is stored in lieu of the base dictionary. */
61 typedef struct T1_ParserRec_
69 FT_Byte* private_dict;
79 #define T1_Add_Table( p, i, o, l ) (p)->funcs.add( (p), i, o, l )
80 #define T1_Done_Table( p ) \
83 if ( (p)->funcs.done ) \
84 (p)->funcs.done( p ); \
86 #define T1_Release_Table( p ) \
89 if ( (p)->funcs.release ) \
90 (p)->funcs.release( p ); \
94 #define T1_Skip_Spaces( p ) (p)->root.funcs.skip_spaces( &(p)->root )
95 #define T1_Skip_Alpha( p ) (p)->root.funcs.skip_alpha ( &(p)->root )
97 #define T1_ToInt( p ) (p)->root.funcs.to_int( &(p)->root )
98 #define T1_ToFixed( p, t ) (p)->root.funcs.to_fixed( &(p)->root, t )
100 #define T1_ToCoordArray( p, m, c ) \
101 (p)->root.funcs.to_coord_array( &(p)->root, m, c )
102 #define T1_ToFixedArray( p, m, f, t ) \
103 (p)->root.funcs.to_fixed_array( &(p)->root, m, f, t )
104 #define T1_ToToken( p, t ) \
105 (p)->root.funcs.to_token( &(p)->root, t )
106 #define T1_ToTokenArray( p, t, m, c ) \
107 (p)->root.funcs.to_token_array( &(p)->root, t, m, c )
109 #define T1_Load_Field( p, f, o, m, pf ) \
110 (p)->root.funcs.load_field( &(p)->root, f, o, m, pf )
111 #define T1_Load_Field_Table( p, f, o, m, pf ) \
112 (p)->root.funcs.load_field_table( &(p)->root, f, o, m, pf )
116 T1_New_Parser( T1_ParserRec* parser,
119 PSAux_Interface* psaux );
122 T1_Get_Private_Dict( T1_ParserRec* parser,
123 PSAux_Interface* psaux );
126 T1_Finalize_Parser( T1_ParserRec* parser );
131 #endif /* __T1PARSE_H__ */