zenilib
0.5.3.0
|
#include <ft2build.h>
#include <FT_FREETYPE_H>
#include <FT_INTERNAL_POSTSCRIPT_AUX_H>
#include "afmparse.h"
#include "psconv.h"
#include "psauxerr.h"
Go to the source code of this file.
Macros | |
#define | AFM_GETC() |
#define | AFM_IS_EOF(ch) ( (ch) == EOF || (ch) == '\x1a' ) |
#define | AFM_IS_NEWLINE(ch) ( (ch) == '\r' || (ch) == '\n' ) |
#define | AFM_IS_SEP(ch) ( (ch) == ';' ) |
#define | AFM_IS_SPACE(ch) ( (ch) == ' ' || (ch) == '\t' ) |
#define | AFM_STATUS_EOC(stream) ( (stream)->status >= AFM_STREAM_STATUS_EOC ) |
#define | AFM_STATUS_EOF(stream) ( (stream)->status >= AFM_STREAM_STATUS_EOF ) |
#define | AFM_STATUS_EOL(stream) ( (stream)->status >= AFM_STREAM_STATUS_EOL ) |
#define | AFM_STREAM_KEY_BEGIN(stream) (char*)( (stream)->cursor - 1 ) |
#define | AFM_STREAM_KEY_LEN(stream, key) ( (char*)(stream)->cursor - key - 1 ) |
#define | EOF -1 |
#define | KERN_INDEX(g1, g2) ( ( (FT_ULong)g1 << 16 ) | g2 ) |
Typedefs | |
typedef struct AFM_StreamRec_ | AFM_StreamRec |
typedef enum AFM_Token_ | AFM_Token |
Functions | |
afm_compare_kern_pairs (const void *a, const void *b) | |
static FT_Error | afm_parse_kern_data (AFM_Parser parser) |
static FT_Error | afm_parse_kern_pairs (AFM_Parser parser) |
static FT_Error | afm_parse_track_kern (AFM_Parser parser) |
afm_parser_done (AFM_Parser parser) | |
afm_parser_init (AFM_Parser parser, FT_Memory memory, FT_Byte *base, FT_Byte *limit) | |
afm_parser_next_key (AFM_Parser parser, FT_Bool line, FT_Offset *len) | |
afm_parser_parse (AFM_Parser parser) | |
afm_parser_read_int (AFM_Parser parser, FT_Int *aint) | |
afm_parser_read_vals (AFM_Parser parser, AFM_Value vals, FT_UInt n) | |
static FT_Error | afm_parser_skip_section (AFM_Parser parser, FT_UInt n, AFM_Token end_section) |
static char * | afm_stream_read_one (AFM_Stream stream) |
static char * | afm_stream_read_string (AFM_Stream stream) |
static int | afm_stream_skip_spaces (AFM_Stream stream) |
static AFM_Token | afm_tokenize (const char *key, FT_Offset len) |
Variables | |
static const char *const | afm_key_table [N_AFM_TOKENS] |
#define AFM_GETC | ( | ) |
Definition at line 70 of file afmparse.c.
Referenced by afm_stream_read_one(), afm_stream_read_string(), and afm_stream_skip_spaces().
#define AFM_IS_EOF | ( | ch | ) | ( (ch) == EOF || (ch) == '\x1a' ) |
Definition at line 64 of file afmparse.c.
Referenced by afm_stream_read_one(), afm_stream_read_string(), and afm_stream_skip_spaces().
Definition at line 62 of file afmparse.c.
Referenced by afm_stream_read_one(), afm_stream_read_string(), and afm_stream_skip_spaces().
#define AFM_IS_SEP | ( | ch | ) | ( (ch) == ';' ) |
Definition at line 68 of file afmparse.c.
Referenced by afm_stream_read_one(), and afm_stream_skip_spaces().
#define AFM_IS_SPACE | ( | ch | ) | ( (ch) == ' ' || (ch) == '\t' ) |
Definition at line 65 of file afmparse.c.
Referenced by afm_stream_read_one(), and afm_stream_skip_spaces().
#define AFM_STATUS_EOC | ( | stream | ) | ( (stream)->status >= AFM_STREAM_STATUS_EOC ) |
Definition at line 80 of file afmparse.c.
Referenced by afm_parser_next_key(), afm_stream_read_one(), and afm_stream_skip_spaces().
#define AFM_STATUS_EOF | ( | stream | ) | ( (stream)->status >= AFM_STREAM_STATUS_EOF ) |
Definition at line 86 of file afmparse.c.
Referenced by afm_parser_next_key().
#define AFM_STATUS_EOL | ( | stream | ) | ( (stream)->status >= AFM_STREAM_STATUS_EOL ) |
Definition at line 83 of file afmparse.c.
Referenced by afm_parser_next_key(), and afm_stream_read_string().
Definition at line 74 of file afmparse.c.
Referenced by afm_stream_read_one(), and afm_stream_read_string().
Definition at line 77 of file afmparse.c.
Referenced by afm_parser_next_key(), and afm_parser_read_vals().
#define EOF -1 |
Definition at line 57 of file afmparse.c.
Referenced by check_header(), get_byte(), get_line(), getLong(), gz_open(), gzread(), gzrewind(), gzseek(), gzungetc(), Zeni::File_Ops::load_asset(), and TMMap::TMMap().
#define KERN_INDEX | ( | g1, | |
g2 | |||
) | ( ( (FT_ULong)g1 << 16 ) | g2 ) |
Definition at line 656 of file afmparse.c.
Referenced by afm_compare_kern_pairs().
typedef struct AFM_StreamRec_ AFM_StreamRec |
typedef enum AFM_Token_ AFM_Token |
anonymous enum |
Enumerator | |
---|---|
AFM_STREAM_STATUS_NORMAL | |
AFM_STREAM_STATUS_EOC | |
AFM_STREAM_STATUS_EOL | |
AFM_STREAM_STATUS_EOF |
Definition at line 36 of file afmparse.c.
enum AFM_Token_ |
Definition at line 198 of file afmparse.c.
Definition at line 661 of file afmparse.c.
References AFM_KernPairRec_::index1, AFM_KernPairRec_::index2, and KERN_INDEX.
Referenced by afm_parse_kern_pairs().
|
static |
Definition at line 772 of file afmparse.c.
References afm_parse_kern_pairs(), afm_parse_track_kern(), afm_parser_next_key(), AFM_TOKEN_ENDFONTMETRICS, AFM_TOKEN_ENDKERNDATA, AFM_TOKEN_STARTKERNPAIRS, AFM_TOKEN_STARTKERNPAIRS0, AFM_TOKEN_STARTTRACKKERN, AFM_TOKEN_UNKNOWN, afm_tokenize(), and error.
Referenced by afm_parser_parse().
|
static |
Definition at line 681 of file afmparse.c.
References afm_compare_kern_pairs(), afm_parser_next_key(), afm_parser_read_int(), afm_parser_read_vals(), AFM_TOKEN_ENDFONTMETRICS, AFM_TOKEN_ENDKERNDATA, AFM_TOKEN_ENDKERNPAIRS, AFM_TOKEN_KP, AFM_TOKEN_KPX, AFM_TOKEN_KPY, AFM_TOKEN_UNKNOWN, afm_tokenize(), AFM_VALUE_TYPE_INDEX, AFM_VALUE_TYPE_INTEGER, error, AFM_ParserRec_::FontInfo, FT_QNEW_ARRAY, ft_qsort, AFM_ValueRec_::i, AFM_KernPairRec_::index1, AFM_KernPairRec_::index2, AFM_FontInfoRec_::KernPairs, AFM_ParserRec_::memory, AFM_FontInfoRec_::NumKernPair, sizeof(), AFM_ValueRec_::type, u, AFM_ValueRec_::u, AFM_KernPairRec_::x, and AFM_KernPairRec_::y.
Referenced by afm_parse_kern_data().
|
static |
Definition at line 583 of file afmparse.c.
References afm_parser_next_key(), afm_parser_read_int(), afm_parser_read_vals(), AFM_TOKEN_ENDFONTMETRICS, AFM_TOKEN_ENDKERNDATA, AFM_TOKEN_ENDTRACKKERN, AFM_TOKEN_TRACKKERN, AFM_TOKEN_UNKNOWN, afm_tokenize(), AFM_VALUE_TYPE_FIXED, AFM_VALUE_TYPE_INTEGER, AFM_TrackKernRec_::degree, error, AFM_ValueRec_::f, AFM_ParserRec_::FontInfo, FT_QNEW_ARRAY, AFM_ValueRec_::i, AFM_TrackKernRec_::max_kern, AFM_TrackKernRec_::max_ptsize, AFM_ParserRec_::memory, AFM_TrackKernRec_::min_kern, AFM_TrackKernRec_::min_ptsize, AFM_FontInfoRec_::NumTrackKern, AFM_FontInfoRec_::TrackKerns, AFM_ValueRec_::type, and AFM_ValueRec_::u.
Referenced by afm_parse_kern_data().
afm_parser_done | ( | AFM_Parser | parser | ) |
Definition at line 553 of file afmparse.c.
References FT_FREE.
afm_parser_init | ( | AFM_Parser | parser, |
FT_Memory | memory, | ||
FT_Byte * | base, | ||
FT_Byte * | limit | ||
) |
Definition at line 525 of file afmparse.c.
References AFM_STREAM_STATUS_EOL, error, FT_NEW, and NULL.
afm_parser_next_key | ( | AFM_Parser | parser, |
FT_Bool | line, | ||
FT_Offset * | len | ||
) |
Definition at line 441 of file afmparse.c.
References AFM_STATUS_EOC, AFM_STATUS_EOF, AFM_STATUS_EOL, AFM_STREAM_KEY_LEN, afm_stream_read_one(), afm_stream_read_string(), and AFM_STREAM_STATUS_NORMAL.
Referenced by afm_parse_kern_data(), afm_parse_kern_pairs(), afm_parse_track_kern(), afm_parser_parse(), and afm_parser_skip_section().
afm_parser_parse | ( | AFM_Parser | parser | ) |
Definition at line 844 of file afmparse.c.
References afm_parse_kern_data(), afm_parser_next_key(), afm_parser_read_int(), afm_parser_read_vals(), afm_parser_skip_section(), AFM_TOKEN_ASCENDER, AFM_TOKEN_DESCENDER, AFM_TOKEN_ENDCHARMETRICS, AFM_TOKEN_ENDFONTMETRICS, AFM_TOKEN_FONTBBOX, AFM_TOKEN_ISCIDFONT, AFM_TOKEN_METRICSSETS, AFM_TOKEN_STARTCHARMETRICS, AFM_TOKEN_STARTKERNDATA, afm_tokenize(), AFM_VALUE_TYPE_BOOL, AFM_VALUE_TYPE_FIXED, AFM_FontInfoRec_::Ascender, AFM_ValueRec_::b, AFM_FontInfoRec_::Descender, error, AFM_ValueRec_::f, AFM_FontInfoRec_::FontBBox, FT_FREE, ft_strncmp, AFM_FontInfoRec_::IsCIDFont, AFM_FontInfoRec_::KernPairs, AFM_FontInfoRec_::NumKernPair, AFM_FontInfoRec_::NumTrackKern, AFM_FontInfoRec_::TrackKerns, AFM_ValueRec_::type, AFM_ValueRec_::u, FT_BBox_::xMax, FT_BBox_::xMin, FT_BBox_::yMax, and FT_BBox_::yMin.
afm_parser_read_int | ( | AFM_Parser | parser, |
FT_Int * | aint | ||
) |
Definition at line 563 of file afmparse.c.
References afm_parser_read_vals(), AFM_VALUE_TYPE_INTEGER, AFM_ValueRec_::i, AFM_ValueRec_::type, and AFM_ValueRec_::u.
Referenced by afm_parse_kern_pairs(), afm_parse_track_kern(), and afm_parser_parse().
afm_parser_read_vals | ( | AFM_Parser | parser, |
AFM_Value | vals, | ||
FT_UInt | n | ||
) |
Definition at line 367 of file afmparse.c.
References AFM_MAX_ARGUMENTS, AFM_STREAM_KEY_LEN, afm_stream_read_one(), afm_stream_read_string(), AFM_VALUE_TYPE_BOOL, AFM_VALUE_TYPE_FIXED, AFM_VALUE_TYPE_INDEX, AFM_VALUE_TYPE_INTEGER, AFM_VALUE_TYPE_NAME, AFM_VALUE_TYPE_STRING, AFM_ValueRec_::b, error, AFM_ValueRec_::f, FT_BOOL, ft_memcpy, FT_QALLOC, ft_strncmp, AFM_ValueRec_::i, i, PS_Conv_ToFixed(), PS_Conv_ToInt(), AFM_ValueRec_::s, str, AFM_ValueRec_::type, and AFM_ValueRec_::u.
Referenced by afm_parse_kern_pairs(), afm_parse_track_kern(), afm_parser_parse(), and afm_parser_read_int().
|
static |
Definition at line 814 of file afmparse.c.
References afm_parser_next_key(), AFM_TOKEN_ENDFONTMETRICS, afm_tokenize(), and NULL.
Referenced by afm_parser_parse().
|
static |
Definition at line 119 of file afmparse.c.
References AFM_GETC, AFM_IS_EOF, AFM_IS_NEWLINE, AFM_IS_SEP, AFM_IS_SPACE, AFM_STATUS_EOC, AFM_STREAM_KEY_BEGIN, afm_stream_skip_spaces(), AFM_STREAM_STATUS_EOC, AFM_STREAM_STATUS_EOF, AFM_STREAM_STATUS_EOL, NULL, and str.
Referenced by afm_parser_next_key(), and afm_parser_read_vals().
|
static |
Definition at line 159 of file afmparse.c.
References AFM_GETC, AFM_IS_EOF, AFM_IS_NEWLINE, AFM_STATUS_EOL, AFM_STREAM_KEY_BEGIN, afm_stream_skip_spaces(), AFM_STREAM_STATUS_EOF, AFM_STREAM_STATUS_EOL, NULL, and str.
Referenced by afm_parser_next_key(), and afm_parser_read_vals().
|
static |
Definition at line 91 of file afmparse.c.
References AFM_GETC, AFM_IS_EOF, AFM_IS_NEWLINE, AFM_IS_SEP, AFM_IS_SPACE, AFM_STATUS_EOC, AFM_STREAM_STATUS_EOC, AFM_STREAM_STATUS_EOF, and AFM_STREAM_STATUS_EOL.
Referenced by afm_stream_read_one(), and afm_stream_read_string().
Definition at line 499 of file afmparse.c.
References afm_key_table, AFM_TOKEN_UNKNOWN, ft_strncmp, and N_AFM_TOKENS.
Referenced by afm_parse_kern_data(), afm_parse_kern_pairs(), afm_parse_track_kern(), afm_parser_parse(), and afm_parser_skip_section().
|
static |
Definition at line 280 of file afmparse.c.
Referenced by afm_tokenize().