#ifndef AFMINT_H
#define AFMINT_H
#ifdef HAVE_CONFIG_H
#include <config.h>
#endif
#include <stdio.h>
#ifndef ___P
#if PROTOTYPES
#define ___P(protos) protos
#else
#define ___P(protos) ()
#endif
#endif
#if STDC_HEADERS
#include <stdlib.h>
#include <string.h>
#else
#if HAVE_STDLIB_H
#include <stdlib.h>
#endif
#if HAVE_STRING_H
#include <string.h>
#endif
#ifndef HAVE_STRCHR
#define strchr index
#define strrchr rindex
#endif
char *strchr ();
char *strrchr ();
#ifndef HAVE_MEMCPY
#define memcpy(d, s, n) bcopy((s), (d), (n))
#endif
#ifndef HAVE_STRERROR
extern char *strerror ___P ((int));
#endif
#endif
#if HAVE_UNISTD_H
#include <unistd.h>
#endif
#include <setjmp.h>
#include <assert.h>
#include <errno.h>
#include <sys/types.h>
#include <sys/stat.h>
#include "afm.h"
#include "strhash.h"
#define AFM_ERROR 1
#define AFM_ERROR_MEMORY 2
#define AFM_ERROR_ARGUMENT 3
#define AFM_ERROR_UNKNOWN_FONT 4
#define AFM_ERROR_SYNTAX 5
#define AFM_ERROR_UNSUPPORTED_FORMAT 6
#define AFM_ERROR_FILE_IO 7
#define AFM_ERROR_NOT_AFM_FILE 8
#define NUM_ERRORS 9
#define SYSERROR(code) (errno << 16 | (code))
typedef enum
{
kComment,
kStartFontMetrics,
kEndFontMetrics,
kStartCompFontMetrics,
kEndCompFontMetrics,
kStartDescendent,
kEndDescendent,
kStartMasterFontMetrics,
kEndMasterFontMetrics,
kMetricsSets,
kDescendents,
kMasters,
kAxes,
kFontName,
kFullName,
kFamilyName,
kWeight,
kFontBBox,
kVersion,
kNotice,
kEncodingScheme,
kMappingScheme,
kEscChar,
kCharacterSet,
kCharacters,
kIsBaseFont,
kVVector,
kIsFixedV,
kCapHeight,
kXHeight,
kAscender,
kDescender,
kWeightVector,
kBlendDesignPositions,
kBlendDesignMap,
kBlendAxisTypes,
kStartDirection,
kEndDirection,
kUnderlinePosition,
kUnderlineThickness,
kItalicAngle,
kCharWidth,
kIsFixedPitch,
kStartCharMetrics,
kEndCharMetrics,
kC,
kCH,
kWX,
kW0X,
kW1X,
kWY,
kW0Y,
kW1Y,
kW,
kW0,
kW1,
kVV,
kN,
kB,
kL,
kStartKernData,
kEndKernData,
kStartTrackKern,
kEndTrackKern,
kTrackKern,
kStartKernPairs,
kEndKernPairs,
kKP,
kKPH,
kKPX,
kKPY,
kStartComposites,
kEndComposites,
kCC,
kPCC,
kStartAxis,
kEndAxis,
kAxisType,
kAxisLabel,
kStartMaster,
kEndMaster
} AFMKey;
struct afm_handle_st
{
unsigned int verbose;
StringHashPtr font_map;
jmp_buf jmpbuf;
AFMError parse_error;
};
struct afm_font_private_data_st
{
AFMIndividualCharacterMetrics *undef;
StringHashPtr fontnames;
StringHashPtr compositenames;
};
struct encoding_table_st
{
int code;
char *character;
};
typedef struct encoding_table_st AFMEncodingTable;
extern AFMEncodingTable afm_88591_encoding[];
extern AFMEncodingTable afm_88592_encoding[];
extern AFMEncodingTable afm_88593_encoding[];
extern AFMEncodingTable afm_88594_encoding[];
extern AFMEncodingTable afm_88595_encoding[];
extern AFMEncodingTable afm_88597_encoding[];
extern AFMEncodingTable afm_ibmpc_encoding[];
extern AFMEncodingTable afm_mac_encoding[];
extern AFMEncodingTable afm_vms_encoding[];
extern AFMEncodingTable afm_hp8_encoding[];
extern AFMEncodingTable afm_koi8_encoding[];
void afm_message ___P ((AFMHandle handle, int level, char *message));
void afm_error ___P ((AFMHandle handle, char *message));
void afm_parse_file ___P ((AFMHandle handle, const char *filename,
AFMFont font));
#endif