xref: /inferno-os/libfreetype/t42parse.h (revision 37da2899f40661e3e9631e497da8dc59b971cbd0)
1 /***************************************************************************/
2 /*                                                                         */
3 /*  t42parse.h                                                             */
4 /*                                                                         */
5 /*    Type 42 font parser (specification).                                 */
6 /*                                                                         */
7 /*  Copyright 2002 by Roberto Alameda.                                     */
8 /*                                                                         */
9 /*  This file is part of the FreeType project, and may only be used,       */
10 /*  modified, and distributed under the terms of the FreeType project      */
11 /*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */
12 /*  this file you indicate that you have read the license and              */
13 /*  understand and accept it fully.                                        */
14 /*                                                                         */
15 /***************************************************************************/
16 
17 
18 #ifndef __T42PARSE_H__
19 #define __T42PARSE_H__
20 
21 
22 #include "t42objs.h"
23 #include FT_INTERNAL_POSTSCRIPT_AUX_H
24 
25 
26 FT_BEGIN_HEADER
27 
28   typedef struct  T42_ParserRec_
29   {
30     PS_ParserRec  root;
31     FT_Stream     stream;
32 
33     FT_Byte*      base_dict;
34     FT_Int        base_len;
35 
36     FT_Byte       in_memory;
37 
38   } T42_ParserRec, *T42_Parser;
39 
40 
41   typedef struct  T42_Loader_
42   {
43     T42_ParserRec  parser;          /* parser used to read the stream */
44 
45     FT_Int         num_chars;       /* number of characters in encoding */
46     PS_TableRec    encoding_table;  /* PS_Table used to store the       */
47                                     /* encoding character names         */
48 
49     FT_Int         num_glyphs;
50     PS_TableRec    glyph_names;
51     PS_TableRec    charstrings;
52 
53   } T42_LoaderRec, *T42_Loader;
54 
55 
56   FT_LOCAL( FT_Error )
57   t42_parser_init( T42_Parser     parser,
58                    FT_Stream      stream,
59                    FT_Memory      memory,
60                    PSAux_Service  psaux );
61 
62   FT_LOCAL( void )
63   t42_parser_done( T42_Parser  parser );
64 
65 
66   FT_LOCAL( FT_Error )
67   t42_parse_dict( T42_Face    face,
68                   T42_Loader  loader,
69                   FT_Byte*    base,
70                   FT_Long     size );
71 
72 
73   FT_LOCAL( void )
74   t42_loader_init( T42_Loader  loader,
75                    T42_Face    face );
76 
77   FT_LOCAL( void )
78   t42_loader_done( T42_Loader  loader );
79 
80 
81  /* */
82 
83 FT_END_HEADER
84 
85 
86 #endif /* __T42PARSE_H__ */
87 
88 
89 /* END */
90