1*b1cdbd2cSJim Jagielski /*
2*b1cdbd2cSJim Jagielski  * (C) 1988, 1989 by Adobe Systems Incorporated. All rights reserved.
3*b1cdbd2cSJim Jagielski  *
4*b1cdbd2cSJim Jagielski  * This file may be freely copied and redistributed as long as:
5*b1cdbd2cSJim Jagielski  *   1) This entire notice continues to be included in the file,
6*b1cdbd2cSJim Jagielski  *   2) If the file has been modified in any way, a notice of such
7*b1cdbd2cSJim Jagielski  *      modification is conspicuously indicated.
8*b1cdbd2cSJim Jagielski  *
9*b1cdbd2cSJim Jagielski  * PostScript, Display PostScript, and Adobe are registered trademarks of
10*b1cdbd2cSJim Jagielski  * Adobe Systems Incorporated.
11*b1cdbd2cSJim Jagielski  *
12*b1cdbd2cSJim Jagielski  * ************************************************************************
13*b1cdbd2cSJim Jagielski  * THE INFORMATION BELOW IS FURNISHED AS IS, IS SUBJECT TO CHANGE WITHOUT
14*b1cdbd2cSJim Jagielski  * NOTICE, AND SHOULD NOT BE CONSTRUED AS A COMMITMENT BY ADOBE SYSTEMS
15*b1cdbd2cSJim Jagielski  * INCORPORATED. ADOBE SYSTEMS INCORPORATED ASSUMES NO RESPONSIBILITY OR
16*b1cdbd2cSJim Jagielski  * LIABILITY FOR ANY ERRORS OR INACCURACIES, MAKES NO WARRANTY OF ANY
17*b1cdbd2cSJim Jagielski  * KIND (EXPRESS, IMPLIED OR STATUTORY) WITH RESPECT TO THIS INFORMATION,
18*b1cdbd2cSJim Jagielski  * AND EXPRESSLY DISCLAIMS ANY AND ALL WARRANTIES OF MERCHANTABILITY,
19*b1cdbd2cSJim Jagielski  * FITNESS FOR PARTICULAR PURPOSES AND NONINFRINGEMENT OF THIRD PARTY RIGHTS.
20*b1cdbd2cSJim Jagielski  * ************************************************************************
21*b1cdbd2cSJim Jagielski  */
22*b1cdbd2cSJim Jagielski 
23*b1cdbd2cSJim Jagielski /*
24*b1cdbd2cSJim Jagielski  * Changes made for OpenOffice.org
25*b1cdbd2cSJim Jagielski  *
26*b1cdbd2cSJim Jagielski  *  10/24/2000 pl       - changed code to compile with c++-compilers
27*b1cdbd2cSJim Jagielski  *                      - added namespace to avoid symbol clashes
28*b1cdbd2cSJim Jagielski  *                      - replaced BOOL by bool
29*b1cdbd2cSJim Jagielski  *                      - added function to free space allocated by parseFile
30*b1cdbd2cSJim Jagielski  *  10/26/2000 pl       - added additional keys
31*b1cdbd2cSJim Jagielski  *                      - added ability to parse slightly broken files
32*b1cdbd2cSJim Jagielski  *                      - added charwidth member to GlobalFontInfo
33*b1cdbd2cSJim Jagielski  *  04/26/2001 pl       - added OpenOffice header
34*b1cdbd2cSJim Jagielski  *  10/19/2005 pl       - changed parseFile to accept a file name instead of a stream
35*b1cdbd2cSJim Jagielski  */
36*b1cdbd2cSJim Jagielski 
37*b1cdbd2cSJim Jagielski /* ParseAFM.h
38*b1cdbd2cSJim Jagielski  *
39*b1cdbd2cSJim Jagielski  * This header file is used in conjuction with the parseAFM.c file.
40*b1cdbd2cSJim Jagielski  * Together these files provide the functionality to parse Adobe Font
41*b1cdbd2cSJim Jagielski  * Metrics files and store the information in predefined data structures.
42*b1cdbd2cSJim Jagielski  * It is intended to work with an application program that needs font metric
43*b1cdbd2cSJim Jagielski  * information. The program can be used as is by making a procedure call to
44*b1cdbd2cSJim Jagielski  * parse an AFM file and have the data stored, or an application developer
45*b1cdbd2cSJim Jagielski  * may wish to customize the code.
46*b1cdbd2cSJim Jagielski  *
47*b1cdbd2cSJim Jagielski  * This header file defines the data structures used as well as the key
48*b1cdbd2cSJim Jagielski  * strings that are currently recognized by this version of the AFM parser.
49*b1cdbd2cSJim Jagielski  * This program is based on the document "Adobe Font Metrics Files,
50*b1cdbd2cSJim Jagielski  * Specification Version 2.0".
51*b1cdbd2cSJim Jagielski  *
52*b1cdbd2cSJim Jagielski  * AFM files are separated into distinct sections of different data. Because
53*b1cdbd2cSJim Jagielski  * of this, the parseAFM program can parse a specified file to only save
54*b1cdbd2cSJim Jagielski  * certain sections of information based on the application's needs. A record
55*b1cdbd2cSJim Jagielski  * containing the requested information will be returned to the application.
56*b1cdbd2cSJim Jagielski  *
57*b1cdbd2cSJim Jagielski  * AFM files are divided into five sections of data:
58*b1cdbd2cSJim Jagielski  *  1) The Global Font Information
59*b1cdbd2cSJim Jagielski  *  2) The Character Metrics Information
60*b1cdbd2cSJim Jagielski  *  3) The Track Kerning Data
61*b1cdbd2cSJim Jagielski  *  4) The Pair-Wise Kerning Data
62*b1cdbd2cSJim Jagielski  *  5) The Composite Character Data
63*b1cdbd2cSJim Jagielski  *
64*b1cdbd2cSJim Jagielski  * Basically, the application can request any of these sections independent
65*b1cdbd2cSJim Jagielski  * of what other sections are requested. In addition, in recognizing that
66*b1cdbd2cSJim Jagielski  * many applications will want ONLY the x-width of characters and not all
67*b1cdbd2cSJim Jagielski  * of the other character metrics information, there is a way to receive
68*b1cdbd2cSJim Jagielski  * only the width information so as not to pay the storage cost for the
69*b1cdbd2cSJim Jagielski  * unwanted data. An application should never request both the
70*b1cdbd2cSJim Jagielski  * "quick and dirty" char metrics (widths only) and the Character Metrics
71*b1cdbd2cSJim Jagielski  * Information since the Character Metrics Information will contain all
72*b1cdbd2cSJim Jagielski  * of the character widths as well.
73*b1cdbd2cSJim Jagielski  *
74*b1cdbd2cSJim Jagielski  * There is a procedure in parseAFM.c, called parseFile, that can be
75*b1cdbd2cSJim Jagielski  * called from any application wishing to get information from the AFM File.
76*b1cdbd2cSJim Jagielski  * This procedure expects 3 parameters: a vaild file descriptor, a pointer
77*b1cdbd2cSJim Jagielski  * to a (FontInfo *) variable (for which space will be allocated and then
78*b1cdbd2cSJim Jagielski  * will be filled in with the data requested), and a mask specifying
79*b1cdbd2cSJim Jagielski  * which data from the AFM File should be saved in the FontInfo structure.
80*b1cdbd2cSJim Jagielski  *
81*b1cdbd2cSJim Jagielski  * The flags that can be used to set the appropriate mask are defined below.
82*b1cdbd2cSJim Jagielski  * In addition, several commonly used masks have already been defined.
83*b1cdbd2cSJim Jagielski  *
84*b1cdbd2cSJim Jagielski  * History:
85*b1cdbd2cSJim Jagielski  *  original: DSM  Thu Oct 20 17:39:59 PDT 1988
86*b1cdbd2cSJim Jagielski  *  modified: DSM  Mon Jul  3 14:17:50 PDT 1989
87*b1cdbd2cSJim Jagielski  *    - added 'storageProblem' return code
88*b1cdbd2cSJim Jagielski  *    - fixed typos
89*b1cdbd2cSJim Jagielski  */
90*b1cdbd2cSJim Jagielski 
91*b1cdbd2cSJim Jagielski #include <stdio.h>
92*b1cdbd2cSJim Jagielski 
93*b1cdbd2cSJim Jagielski namespace psp {
94*b1cdbd2cSJim Jagielski 
95*b1cdbd2cSJim Jagielski /* your basic constants */
96*b1cdbd2cSJim Jagielski #define EOL '\n'                /* end-of-line indicator */
97*b1cdbd2cSJim Jagielski #define MAX_NAME 4096           /* max length for identifiers */
98*b1cdbd2cSJim Jagielski #define FLAGS int
99*b1cdbd2cSJim Jagielski 
100*b1cdbd2cSJim Jagielski 
101*b1cdbd2cSJim Jagielski 
102*b1cdbd2cSJim Jagielski /* Flags that can be AND'ed together to specify exactly what
103*b1cdbd2cSJim Jagielski  * information from the AFM file should be saved.
104*b1cdbd2cSJim Jagielski  */
105*b1cdbd2cSJim Jagielski #define P_G 0x01    /* 0000 0001 */   /* Global Font Info      */
106*b1cdbd2cSJim Jagielski #define P_W 0x02    /* 0000 0010 */   /* Character Widths ONLY */
107*b1cdbd2cSJim Jagielski #define P_M 0x06    /* 0000 0110 */   /* All Char Metric Info  */
108*b1cdbd2cSJim Jagielski #define P_P 0x08    /* 0000 1000 */   /* Pair Kerning Info     */
109*b1cdbd2cSJim Jagielski #define P_T 0x10    /* 0001 0000 */   /* Track Kerning Info    */
110*b1cdbd2cSJim Jagielski #define P_C 0x20    /* 0010 0000 */   /* Composite Char Info   */
111*b1cdbd2cSJim Jagielski 
112*b1cdbd2cSJim Jagielski 
113*b1cdbd2cSJim Jagielski /* Commonly used flags
114*b1cdbd2cSJim Jagielski  */
115*b1cdbd2cSJim Jagielski #define P_GW    (P_G | P_W)
116*b1cdbd2cSJim Jagielski #define P_GM    (P_G | P_M)
117*b1cdbd2cSJim Jagielski #define P_GMP   (P_G | P_M | P_P)
118*b1cdbd2cSJim Jagielski #define P_GMK   (P_G | P_M | P_P | P_T)
119*b1cdbd2cSJim Jagielski #define P_ALL   (P_G | P_M | P_P | P_T | P_C)
120*b1cdbd2cSJim Jagielski 
121*b1cdbd2cSJim Jagielski 
122*b1cdbd2cSJim Jagielski 
123*b1cdbd2cSJim Jagielski /* Possible return codes from the parseFile procedure.
124*b1cdbd2cSJim Jagielski  *
125*b1cdbd2cSJim Jagielski  * ok means there were no problems parsing the file.
126*b1cdbd2cSJim Jagielski  *
127*b1cdbd2cSJim Jagielski  * parseError means that there was some kind of parsing error, but the
128*b1cdbd2cSJim Jagielski  * parser went on. This could include problems like the count for any given
129*b1cdbd2cSJim Jagielski  * section does not add up to how many entries there actually were, or
130*b1cdbd2cSJim Jagielski  * there was a key that was not recognized. The return record may contain
131*b1cdbd2cSJim Jagielski  * vaild data or it may not.
132*b1cdbd2cSJim Jagielski  *
133*b1cdbd2cSJim Jagielski  * earlyEOF means that an End of File was encountered before expected. This
134*b1cdbd2cSJim Jagielski  * may mean that the AFM file had been truncated, or improperly formed.
135*b1cdbd2cSJim Jagielski  *
136*b1cdbd2cSJim Jagielski  * storageProblem means that there were problems allocating storage for
137*b1cdbd2cSJim Jagielski  * the data structures that would have contained the AFM data.
138*b1cdbd2cSJim Jagielski  */
139*b1cdbd2cSJim Jagielski 
140*b1cdbd2cSJim Jagielski enum afmError { ok = 0, parseError = -1, earlyEOF = -2, storageProblem = -3 };
141*b1cdbd2cSJim Jagielski 
142*b1cdbd2cSJim Jagielski 
143*b1cdbd2cSJim Jagielski /************************* TYPES *********************************/
144*b1cdbd2cSJim Jagielski /* Below are all of the data structure definitions. These structures
145*b1cdbd2cSJim Jagielski  * try to map as closely as possible to grouping and naming of data
146*b1cdbd2cSJim Jagielski  * in the AFM Files.
147*b1cdbd2cSJim Jagielski  */
148*b1cdbd2cSJim Jagielski 
149*b1cdbd2cSJim Jagielski 
150*b1cdbd2cSJim Jagielski /* Bounding box definition. Used for the Font BBox as well as the
151*b1cdbd2cSJim Jagielski  * Character BBox.
152*b1cdbd2cSJim Jagielski  */
153*b1cdbd2cSJim Jagielski typedef struct
154*b1cdbd2cSJim Jagielski {
155*b1cdbd2cSJim Jagielski     int llx;    /* lower left x-position  */
156*b1cdbd2cSJim Jagielski     int lly;    /* lower left y-position  */
157*b1cdbd2cSJim Jagielski     int urx;    /* upper right x-position */
158*b1cdbd2cSJim Jagielski     int ury;    /* upper right y-position */
159*b1cdbd2cSJim Jagielski } BBox;
160*b1cdbd2cSJim Jagielski 
161*b1cdbd2cSJim Jagielski 
162*b1cdbd2cSJim Jagielski /* Global Font information.
163*b1cdbd2cSJim Jagielski  * The key that each field is associated with is in comments. For an
164*b1cdbd2cSJim Jagielski  * explanation about each key and its value please refer to the AFM
165*b1cdbd2cSJim Jagielski  * documentation (full title & version given above).
166*b1cdbd2cSJim Jagielski  */
167*b1cdbd2cSJim Jagielski typedef struct
168*b1cdbd2cSJim Jagielski {
169*b1cdbd2cSJim Jagielski     char *afmVersion;       /* key: StartFontMetrics */
170*b1cdbd2cSJim Jagielski     char *fontName;     /* key: FontName */
171*b1cdbd2cSJim Jagielski     char *fullName;     /* key: FullName */
172*b1cdbd2cSJim Jagielski     char *familyName;       /* key: FamilyName */
173*b1cdbd2cSJim Jagielski     char *weight;       /* key: Weight */
174*b1cdbd2cSJim Jagielski     float italicAngle;      /* key: ItalicAngle */
175*b1cdbd2cSJim Jagielski     bool isFixedPitch;      /* key: IsFixedPitch */
176*b1cdbd2cSJim Jagielski     BBox fontBBox;      /* key: FontBBox */
177*b1cdbd2cSJim Jagielski     int underlinePosition;      /* key: UnderlinePosition */
178*b1cdbd2cSJim Jagielski     int underlineThickness;     /* key: UnderlineThickness */
179*b1cdbd2cSJim Jagielski     char *version;      /* key: Version */
180*b1cdbd2cSJim Jagielski     char *notice;       /* key: Notice */
181*b1cdbd2cSJim Jagielski     char *encodingScheme;   /* key: EncodingScheme */
182*b1cdbd2cSJim Jagielski     int capHeight;      /* key: CapHeight */
183*b1cdbd2cSJim Jagielski     int xHeight;            /* key: XHeight */
184*b1cdbd2cSJim Jagielski     int ascender;       /* key: Ascender */
185*b1cdbd2cSJim Jagielski     int descender;      /* key: Descender */
186*b1cdbd2cSJim Jagielski     int charwidth;      /* key: CharWidth */
187*b1cdbd2cSJim Jagielski } GlobalFontInfo;
188*b1cdbd2cSJim Jagielski 
189*b1cdbd2cSJim Jagielski 
190*b1cdbd2cSJim Jagielski /* Ligature definition is a linked list since any character can have
191*b1cdbd2cSJim Jagielski  * any number of ligatures.
192*b1cdbd2cSJim Jagielski  */
193*b1cdbd2cSJim Jagielski typedef struct _t_ligature
194*b1cdbd2cSJim Jagielski {
195*b1cdbd2cSJim Jagielski     char *succ, *lig;
196*b1cdbd2cSJim Jagielski     struct _t_ligature *next;
197*b1cdbd2cSJim Jagielski } Ligature;
198*b1cdbd2cSJim Jagielski 
199*b1cdbd2cSJim Jagielski 
200*b1cdbd2cSJim Jagielski /* Character Metric Information. This structure is used only if ALL
201*b1cdbd2cSJim Jagielski  * character metric information is requested. If only the character
202*b1cdbd2cSJim Jagielski  * widths is requested, then only an array of the character x-widths
203*b1cdbd2cSJim Jagielski  * is returned.
204*b1cdbd2cSJim Jagielski  *
205*b1cdbd2cSJim Jagielski  * The key that each field is associated with is in comments. For an
206*b1cdbd2cSJim Jagielski  * explanation about each key and its value please refer to the
207*b1cdbd2cSJim Jagielski  * Character Metrics section of the AFM documentation (full title
208*b1cdbd2cSJim Jagielski  * & version given above).
209*b1cdbd2cSJim Jagielski  */
210*b1cdbd2cSJim Jagielski typedef struct
211*b1cdbd2cSJim Jagielski {
212*b1cdbd2cSJim Jagielski     int code,       /* key: C */
213*b1cdbd2cSJim Jagielski         wx,     /* key: WX */
214*b1cdbd2cSJim Jagielski         w0x,        /* key: W0X */
215*b1cdbd2cSJim Jagielski         wy;     /* together wx and wy are associated with key: W */
216*b1cdbd2cSJim Jagielski     char *name;     /* key: N */
217*b1cdbd2cSJim Jagielski     BBox charBBox;  /* key: B */
218*b1cdbd2cSJim Jagielski     Ligature *ligs; /* key: L (linked list; not a fixed number of Ls */
219*b1cdbd2cSJim Jagielski } CharMetricInfo;
220*b1cdbd2cSJim Jagielski 
221*b1cdbd2cSJim Jagielski 
222*b1cdbd2cSJim Jagielski /* Track kerning data structure.
223*b1cdbd2cSJim Jagielski  * The fields of this record are the five values associated with every
224*b1cdbd2cSJim Jagielski  * TrackKern entry.
225*b1cdbd2cSJim Jagielski  *
226*b1cdbd2cSJim Jagielski  * For an explanation about each value please refer to the
227*b1cdbd2cSJim Jagielski  * Track Kerning section of the AFM documentation (full title
228*b1cdbd2cSJim Jagielski  * & version given above).
229*b1cdbd2cSJim Jagielski  */
230*b1cdbd2cSJim Jagielski typedef struct
231*b1cdbd2cSJim Jagielski {
232*b1cdbd2cSJim Jagielski     int degree;
233*b1cdbd2cSJim Jagielski     float minPtSize,
234*b1cdbd2cSJim Jagielski         minKernAmt,
235*b1cdbd2cSJim Jagielski         maxPtSize,
236*b1cdbd2cSJim Jagielski         maxKernAmt;
237*b1cdbd2cSJim Jagielski } TrackKernData;
238*b1cdbd2cSJim Jagielski 
239*b1cdbd2cSJim Jagielski 
240*b1cdbd2cSJim Jagielski /* Pair Kerning data structure.
241*b1cdbd2cSJim Jagielski  * The fields of this record are the four values associated with every
242*b1cdbd2cSJim Jagielski  * KP entry. For KPX entries, the yamt will be zero.
243*b1cdbd2cSJim Jagielski  *
244*b1cdbd2cSJim Jagielski  * For an explanation about each value please refer to the
245*b1cdbd2cSJim Jagielski  * Pair Kerning section of the AFM documentation (full title
246*b1cdbd2cSJim Jagielski  * & version given above).
247*b1cdbd2cSJim Jagielski  */
248*b1cdbd2cSJim Jagielski typedef struct
249*b1cdbd2cSJim Jagielski {
250*b1cdbd2cSJim Jagielski     char *name1;
251*b1cdbd2cSJim Jagielski     char *name2;
252*b1cdbd2cSJim Jagielski     int xamt,
253*b1cdbd2cSJim Jagielski         yamt;
254*b1cdbd2cSJim Jagielski } PairKernData;
255*b1cdbd2cSJim Jagielski 
256*b1cdbd2cSJim Jagielski 
257*b1cdbd2cSJim Jagielski /* PCC is a piece of a composite character. This is a sub structure of a
258*b1cdbd2cSJim Jagielski  * compCharData described below.
259*b1cdbd2cSJim Jagielski  * These fields will be filled in with the values from the key PCC.
260*b1cdbd2cSJim Jagielski  *
261*b1cdbd2cSJim Jagielski  * For an explanation about each key and its value please refer to the
262*b1cdbd2cSJim Jagielski  * Composite Character section of the AFM documentation (full title
263*b1cdbd2cSJim Jagielski  * & version given above).
264*b1cdbd2cSJim Jagielski  */
265*b1cdbd2cSJim Jagielski typedef struct
266*b1cdbd2cSJim Jagielski {
267*b1cdbd2cSJim Jagielski     char *pccName;
268*b1cdbd2cSJim Jagielski     int deltax,
269*b1cdbd2cSJim Jagielski         deltay;
270*b1cdbd2cSJim Jagielski } Pcc;
271*b1cdbd2cSJim Jagielski 
272*b1cdbd2cSJim Jagielski 
273*b1cdbd2cSJim Jagielski /* Composite Character Information data structure.
274*b1cdbd2cSJim Jagielski  * The fields ccName and numOfPieces are filled with the values associated
275*b1cdbd2cSJim Jagielski  * with the key CC. The field pieces points to an array (size = numOfPieces)
276*b1cdbd2cSJim Jagielski  * of information about each of the parts of the composite character. That
277*b1cdbd2cSJim Jagielski  * array is filled in with the values from the key PCC.
278*b1cdbd2cSJim Jagielski  *
279*b1cdbd2cSJim Jagielski  * For an explanation about each key and its value please refer to the
280*b1cdbd2cSJim Jagielski  * Composite Character section of the AFM documentation (full title
281*b1cdbd2cSJim Jagielski  * & version given above).
282*b1cdbd2cSJim Jagielski  */
283*b1cdbd2cSJim Jagielski typedef struct
284*b1cdbd2cSJim Jagielski {
285*b1cdbd2cSJim Jagielski     char *ccName;
286*b1cdbd2cSJim Jagielski     int numOfPieces;
287*b1cdbd2cSJim Jagielski     Pcc *pieces;
288*b1cdbd2cSJim Jagielski } CompCharData;
289*b1cdbd2cSJim Jagielski 
290*b1cdbd2cSJim Jagielski 
291*b1cdbd2cSJim Jagielski /*  FontInfo
292*b1cdbd2cSJim Jagielski  *  Record type containing pointers to all of the other data
293*b1cdbd2cSJim Jagielski  *  structures containing information about a font.
294*b1cdbd2cSJim Jagielski  *  A a record of this type is filled with data by the
295*b1cdbd2cSJim Jagielski  *  parseFile function.
296*b1cdbd2cSJim Jagielski  */
297*b1cdbd2cSJim Jagielski typedef struct
298*b1cdbd2cSJim Jagielski {
299*b1cdbd2cSJim Jagielski     GlobalFontInfo *gfi;    /* ptr to a GlobalFontInfo record */
300*b1cdbd2cSJim Jagielski     int *cwi;           /* ptr to 256 element array of just char widths */
301*b1cdbd2cSJim Jagielski     int numOfChars;     /* number of entries in char metrics array */
302*b1cdbd2cSJim Jagielski     CharMetricInfo *cmi;    /* ptr to char metrics array */
303*b1cdbd2cSJim Jagielski     int numOfTracks;        /* number to entries in track kerning array */
304*b1cdbd2cSJim Jagielski     TrackKernData *tkd;     /* ptr to track kerning array */
305*b1cdbd2cSJim Jagielski     int numOfPairs;     /* number to entries in pair kerning array */
306*b1cdbd2cSJim Jagielski     PairKernData *pkd;      /* ptr to pair kerning array */
307*b1cdbd2cSJim Jagielski     int numOfComps;     /* number to entries in comp char array */
308*b1cdbd2cSJim Jagielski     CompCharData *ccd;      /* ptr to comp char array */
309*b1cdbd2cSJim Jagielski } FontInfo;
310*b1cdbd2cSJim Jagielski 
311*b1cdbd2cSJim Jagielski 
312*b1cdbd2cSJim Jagielski 
313*b1cdbd2cSJim Jagielski /************************* PROCEDURES ****************************/
314*b1cdbd2cSJim Jagielski 
315*b1cdbd2cSJim Jagielski /*  Call this procedure to do the grunt work of parsing an AFM file.
316*b1cdbd2cSJim Jagielski  *
317*b1cdbd2cSJim Jagielski  *  "fp" should be a valid file pointer to an AFM file.
318*b1cdbd2cSJim Jagielski  *
319*b1cdbd2cSJim Jagielski  *  "fi" is a pointer to a pointer to a FontInfo record sturcture
320*b1cdbd2cSJim Jagielski  *  (defined above). Storage for the FontInfo structure will be
321*b1cdbd2cSJim Jagielski  *  allocated in parseFile and the structure will be filled in
322*b1cdbd2cSJim Jagielski  *  with the requested data from the AFM File.
323*b1cdbd2cSJim Jagielski  *
324*b1cdbd2cSJim Jagielski  *  "flags" is a mask with bits set representing what data should
325*b1cdbd2cSJim Jagielski  *  be saved. Defined above are valid flags that can be used to set
326*b1cdbd2cSJim Jagielski  *  the mask, as well as a few commonly used masks.
327*b1cdbd2cSJim Jagielski  *
328*b1cdbd2cSJim Jagielski  *  The possible return codes from parseFile are defined above.
329*b1cdbd2cSJim Jagielski  */
330*b1cdbd2cSJim Jagielski 
331*b1cdbd2cSJim Jagielski int parseFile( const char* pFilename, FontInfo **fi, FLAGS flags );
332*b1cdbd2cSJim Jagielski void freeFontInfo(FontInfo *fi);
333*b1cdbd2cSJim Jagielski 
334*b1cdbd2cSJim Jagielski } // namespace
335