2 * Internal header for the AFM library.
3 * Copyright (c) 1995-1999 Markku Rossi.
5 * Author: Markku Rossi <mtr@iki.fi>
9 * This program is free software; you can redistribute it and/or modify
10 * it under the terms of the GNU General Public License as published by
11 * the Free Software Foundation; either version 2, or (at your option)
14 * This program is distributed in the hope that it will be useful,
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 * GNU General Public License for more details.
19 * You should have received a copy of the GNU General Public License
20 * along with this program; see the file COPYING. If not, write to
21 * the Free Software Foundation, 51 Franklin Street, Fifth Floor,
22 * Boston, MA 02110-1301, USA.
40 #define ___P(protos) protos
41 #else /* no PROTOTYPES */
42 #define ___P(protos) ()
43 #endif /* no PROTOTYPES */
51 #else /* no STDC_HEADERS */
63 #define strrchr rindex
69 #define memcpy(d, s, n) bcopy((s), (d), (n))
73 extern char *strerror ___P ((int));
76 #endif /* no STDC_HEADERS */
86 #include <sys/types.h>
94 * Types and definitions.
99 #define AFM_ERROR_MEMORY 2
100 #define AFM_ERROR_ARGUMENT 3
101 #define AFM_ERROR_UNKNOWN_FONT 4
102 #define AFM_ERROR_SYNTAX 5
103 #define AFM_ERROR_UNSUPPORTED_FORMAT 6
104 #define AFM_ERROR_FILE_IO 7
105 #define AFM_ERROR_NOT_AFM_FILE 8
108 /* Pack error and global errno. */
109 #define SYSERROR(code) (errno << 16 | (code))
118 /* File structure. */
121 kStartCompFontMetrics,
125 kStartMasterFontMetrics,
126 kEndMasterFontMetrics,
128 /* Control information. */
134 /* Global font information. */
155 kBlendDesignPositions,
159 /* Writing direction information. */
168 /* Individual character metrics. */
200 /* Composite character data. */
206 /* Axis information. */
212 /* Master Design Information */
221 unsigned int verbose; /* verbose level */
222 StringHashPtr font_map; /* fontname -> AFM filename mapping */
226 AFMError parse_error; /* Error that caused longjmp(). */
230 /* Store library's private font data to this structure. */
231 struct afm_font_private_data_st
233 /* Character that is used for undefined codes (' '). */
234 AFMIndividualCharacterMetrics *undef;
236 StringHashPtr fontnames; /* fontname -> character info mapping */
237 StringHashPtr compositenames; /* composite -> AFMComposite mapping */
245 struct encoding_table_st
251 typedef struct encoding_table_st AFMEncodingTable;
253 extern AFMEncodingTable afm_88591_encoding[];
254 extern AFMEncodingTable afm_88592_encoding[];
255 extern AFMEncodingTable afm_88593_encoding[];
256 extern AFMEncodingTable afm_88594_encoding[];
257 extern AFMEncodingTable afm_88595_encoding[];
258 extern AFMEncodingTable afm_88597_encoding[];
259 extern AFMEncodingTable afm_88599_encoding[];
260 extern AFMEncodingTable afm_885910_encoding[];
261 extern AFMEncodingTable afm_ibmpc_encoding[];
262 extern AFMEncodingTable afm_mac_encoding[];
263 extern AFMEncodingTable afm_vms_encoding[];
264 extern AFMEncodingTable afm_hp8_encoding[];
265 extern AFMEncodingTable afm_koi8_encoding[];
269 * Global help functions.
272 /* Print message if <level> is larger than library's verbose level. */
273 void afm_message ___P ((AFMHandle handle, unsigned int level, char *message));
275 /* Print error message to stderr. */
276 void afm_error ___P ((AFMHandle handle, char *message));
283 /* Parse AFM file <filename> and fill up font <font>. */
284 void afm_parse_file ___P ((AFMHandle handle, const char *filename,
287 #endif /* not AFMINT_H */