1 /****************************************************************************
5 * Type 1 parser (specification).
7 * Copyright (C) 1996-2023 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.
23 #include <freetype/internal/t1types.h>
24 #include <freetype/internal/ftstream.h>
30 /**************************************************************************
36 * A PS_ParserRec is an object used to parse a Type 1 fonts very
44 * The current input stream.
47 * A pointer to the top-level dictionary.
50 * The length in bytes of the top dictionary.
53 * A pointer to the private dictionary.
56 * The length in bytes of the private dictionary.
59 * A boolean. Indicates that we are handling a PFB
63 * A boolean. Indicates a memory-based stream.
66 * A boolean. Indicates that the private dictionary
67 * is stored in lieu of the base dictionary.
69 typedef struct T1_ParserRec_
77 FT_Byte* private_dict;
84 } T1_ParserRec, *T1_Parser;
87 #define T1_Add_Table( p, i, o, l ) (p)->funcs.add( (p), i, o, l )
88 #define T1_Release_Table( p ) \
91 if ( (p)->funcs.release ) \
92 (p)->funcs.release( p ); \
96 #define T1_Skip_Spaces( p ) (p)->root.funcs.skip_spaces( &(p)->root )
97 #define T1_Skip_PS_Token( p ) (p)->root.funcs.skip_PS_token( &(p)->root )
99 #define T1_ToInt( p ) (p)->root.funcs.to_int( &(p)->root )
100 #define T1_ToFixed( p, t ) (p)->root.funcs.to_fixed( &(p)->root, t )
102 #define T1_ToCoordArray( p, m, c ) \
103 (p)->root.funcs.to_coord_array( &(p)->root, m, c )
104 #define T1_ToFixedArray( p, m, f, t ) \
105 (p)->root.funcs.to_fixed_array( &(p)->root, m, f, t )
106 #define T1_ToToken( p, t ) \
107 (p)->root.funcs.to_token( &(p)->root, t )
108 #define T1_ToTokenArray( p, t, m, c ) \
109 (p)->root.funcs.to_token_array( &(p)->root, t, m, c )
111 #define T1_Load_Field( p, f, o, m, pf ) \
112 (p)->root.funcs.load_field( &(p)->root, f, o, m, pf )
114 #define T1_Load_Field_Table( p, f, o, m, pf ) \
115 (p)->root.funcs.load_field_table( &(p)->root, f, o, m, pf )
119 T1_New_Parser( T1_Parser parser,
122 PSAux_Service psaux );
125 T1_Get_Private_Dict( T1_Parser parser,
126 PSAux_Service psaux );
129 T1_Finalize_Parser( T1_Parser parser );
134 #endif /* T1PARSE_H_ */