1 /* Copyright (C) 1998, 1999 artofcode LLC.  All rights reserved.
2 
3   This program is free software; you can redistribute it and/or modify it
4   under the terms of the GNU General Public License as published by the
5   Free Software Foundation; either version 2 of the License, or (at your
6   option) any later version.
7 
8   This program is distributed in the hope that it will be useful, but
9   WITHOUT ANY WARRANTY; without even the implied warranty of
10   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
11   General Public License for more details.
12 
13   You should have received a copy of the GNU General Public License along
14   with this program; if not, write to the Free Software Foundation, Inc.,
15   59 Temple Place, Suite 330, Boston, MA, 02111-1307.
16 
17 */
18 
19 /*$Id: ifont1.h,v 1.3.6.1.2.1 2003/01/17 00:49:04 giles Exp $ */
20 /* Type 1 font utilities shared with Type 2 */
21 
22 #ifndef ifont1_INCLUDED
23 #  define ifont1_INCLUDED
24 
25 /*
26  * Define the temporary structure for holding pointers to substructures of a
27  * CharString-based font.  This is used for parsing Type 1, 2, and 4 fonts.
28  */
29 typedef struct charstring_font_refs_s {
30     ref *Private;
31     ref no_subrs;
32     ref *OtherSubrs;
33     ref *Subrs;
34     ref *GlobalSubrs;
35 } charstring_font_refs_t;
36 
37 /* Define the default lenIV value for a Type 1 font. */
38 #define DEFAULT_LENIV_1 4
39 
40 /*
41  * Parse the substructures of a CharString-based font.
42  */
43 int charstring_font_get_refs(P2(const_os_ptr op, charstring_font_refs_t *pfr));
44 
45 /*
46  * Get the parameters of a CharString-based font or a FDArray entry for a
47  * CIDFontType 0 font.  The client has filled in pdata1->interpret,
48  * subroutineNumberBias, lenIV, and (if applicable) the Type 2 elements.
49  */
50 int charstring_font_params(P3(const_os_ptr op, charstring_font_refs_t *pfr,
51 			      gs_type1_data *pdata1));
52 
53 /*
54  * Fill in a newly built CharString-based font or FDArray entry.
55  */
56 int charstring_font_init(P3(gs_font_type1 *pfont,
57 			    const charstring_font_refs_t *pfr,
58 			    const gs_type1_data *pdata1));
59 
60 /*
61  * Finish building a CharString-based font.  The client has filled in the
62  * same elements as for charstring_font_params.
63  */
64 int build_charstring_font(P7(i_ctx_t *i_ctx_p, os_ptr op,
65 			     build_proc_refs * pbuild, font_type ftype,
66 			     charstring_font_refs_t *pfr,
67 			     gs_type1_data *pdata1,
68 			     build_font_options_t options));
69 
70 #endif /* ifont1_INCLUDED */
71