afmparse.c File Reference

#include <ft2build.h>
#include "afmparse.h"
#include "psconv.h"
#include "psauxerr.h"

Go to the source code of this file.

Classes

struct  AFM_StreamRec_

Defines

#define EOF   -1
#define AFM_IS_NEWLINE(ch)   ( (ch) == '\r' || (ch) == '\n' )
#define AFM_IS_EOF(ch)   ( (ch) == EOF || (ch) == '\x1a' )
#define AFM_IS_SPACE(ch)   ( (ch) == ' ' || (ch) == '\t' )
#define AFM_IS_SEP(ch)   ( (ch) == ';' )
#define AFM_GETC()
#define AFM_STREAM_KEY_BEGIN(stream)   (char*)( (stream)->cursor - 1 )
#define AFM_STREAM_KEY_LEN(stream, key)   ( (char*)(stream)->cursor - key - 1 )
#define AFM_STATUS_EOC(stream)   ( (stream)->status >= AFM_STREAM_STATUS_EOC )
#define AFM_STATUS_EOL(stream)   ( (stream)->status >= AFM_STREAM_STATUS_EOL )
#define AFM_STATUS_EOF(stream)   ( (stream)->status >= AFM_STREAM_STATUS_EOF )
#define KERN_INDEX(g1, g2)   ( ( (FT_ULong)g1 << 16 ) | g2 )

Typedefs

typedef AFM_StreamRec_ AFM_StreamRec
typedef enum AFM_Token_ AFM_Token

Enumerations

enum  
enum  AFM_Token_

Functions

static int afm_stream_skip_spaces (AFM_Stream stream)
static char * afm_stream_read_one (AFM_Stream stream)
static char * afm_stream_read_string (AFM_Stream stream)
 afm_parser_read_vals (AFM_Parser parser, AFM_Value vals, FT_UInt n)
 afm_parser_next_key (AFM_Parser parser, FT_Bool line, FT_Offset *len)
static AFM_Token afm_tokenize (const char *key, FT_Offset len)
 afm_parser_init (AFM_Parser parser, FT_Memory memory, FT_Byte *base, FT_Byte *limit)
 afm_parser_done (AFM_Parser parser)
 afm_parser_read_int (AFM_Parser parser, FT_Int *aint)
static FT_Error afm_parse_track_kern (AFM_Parser parser)
 afm_compare_kern_pairs (const void *a, const void *b)
static FT_Error afm_parse_kern_pairs (AFM_Parser parser)
static FT_Error afm_parse_kern_data (AFM_Parser parser)
static FT_Error afm_parser_skip_section (AFM_Parser parser, FT_UInt n, AFM_Token end_section)
 afm_parser_parse (AFM_Parser parser)

Variables

static const char *const afm_key_table [N_AFM_TOKENS]


Define Documentation

 
#define AFM_GETC (  ) 

Value:

( ( (stream)->cursor < (stream)->limit ) ? *(stream)->cursor++ \
                                                   : EOF )

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().

#define AFM_IS_NEWLINE ( ch   )     ( (ch) == '\r' || (ch) == '\n' )

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().

#define AFM_STREAM_KEY_BEGIN ( stream   )     (char*)( (stream)->cursor - 1 )

Definition at line 74 of file afmparse.c.

Referenced by afm_stream_read_one(), and afm_stream_read_string().

#define AFM_STREAM_KEY_LEN ( stream,
key   )     ( (char*)(stream)->cursor - key - 1 )

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 AnalysePS(), TGText::Append(), TProofServ::CatMotd(), check_header(), TSystem::CompileMacro(), gdk_pixmap_read_string(), gdk_pixmap_seek_char(), get_byte(), getargs(), getbintix(), getLong(), GRSThttpGetCGI(), GRSTx509CacheProxy(), gz_open(), gzread(), gzrewind(), gzseek(), gzungetc(), main(), TEnvParser::Parse(), R__fill_window(), R__lm_init(), TDatabasePDG::ReadPDGTable(), ReadRulesContent(), ReadUtmp(), TUnixSystem::ReadUtmpFile(), RootdExpandPathName(), RootdLsdir(), ROOT::RpdCheckDaemon(), rsa_num_fget(), rsa_num_fput(), rsa_num_sget(), rsa_num_sput(), TGText::Save(), and TTreePlayer::Scan().

#define KERN_INDEX ( g1,
g2   )     ( ( (FT_ULong)g1 << 16 ) | g2 )

Definition at line 659 of file afmparse.c.

Referenced by afm_compare_kern_pairs(), compare_kern_pairs(), and T1_Get_Kerning().


Typedef Documentation

typedef struct AFM_StreamRec_ AFM_StreamRec

typedef enum AFM_Token_ AFM_Token


Enumeration Type Documentation

anonymous enum

Definition at line 36 of file afmparse.c.

enum AFM_Token_

Definition at line 198 of file afmparse.c.


Function Documentation

afm_compare_kern_pairs ( const void *  a,
const void *  b 
)

Definition at line 664 of file afmparse.c.

References AFM_KernPairRec_::index1, AFM_KernPairRec_::index2, and KERN_INDEX.

Referenced by afm_parse_kern_pairs().

static FT_Error afm_parse_kern_data ( AFM_Parser  parser  )  [static]

Definition at line 775 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(), error, and len.

Referenced by afm_parser_parse().

static FT_Error afm_parse_kern_pairs ( AFM_Parser  parser  )  [static]

Definition at line 684 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, fi, AFM_ParserRec_::FontInfo, FT_QNEW_ARRAY, ft_qsort, AFM_ValueRec_::i, AFM_KernPairRec_::index1, AFM_KernPairRec_::index2, AFM_FontInfoRec_::KernPairs, len, AFM_ParserRec_::memory, n, AFM_FontInfoRec_::NumKernPair, AFM_ValueRec_::type, u, AFM_ValueRec_::u, AFM_KernPairRec_::x, and AFM_KernPairRec_::y.

Referenced by afm_parse_kern_data().

static FT_Error afm_parse_track_kern ( AFM_Parser  parser  )  [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, fi, AFM_ParserRec_::FontInfo, FT_QNEW_ARRAY, AFM_ValueRec_::i, len, AFM_TrackKernRec_::max_kern, AFM_TrackKernRec_::max_ptsize, AFM_ParserRec_::memory, AFM_TrackKernRec_::min_kern, AFM_TrackKernRec_::min_ptsize, n, 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, NULL, and PC3::stream().

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(), AFM_STREAM_STATUS_NORMAL, and PC3::stream().

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 847 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, fi, AFM_FontInfoRec_::FontBBox, FT_FREE, ft_strncmp, AFM_FontInfoRec_::IsCIDFont, AFM_FontInfoRec_::KernPairs, len, n, 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, and val.

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, error, FT_BOOL, ft_memcpy, FT_QALLOC, ft_strncmp, i, len, PS_Conv_ToFixed(), PS_Conv_ToInt(), str, PC3::stream(), and val.

Referenced by afm_parse_kern_pairs(), afm_parse_track_kern(), afm_parser_parse(), and afm_parser_read_int().

static FT_Error afm_parser_skip_section ( AFM_Parser  parser,
FT_UInt  n,
AFM_Token  end_section 
) [static]

Definition at line 817 of file afmparse.c.

References afm_parser_next_key(), AFM_TOKEN_ENDFONTMETRICS, afm_tokenize(), len, and NULL.

Referenced by afm_parser_parse().

static char* afm_stream_read_one ( AFM_Stream  stream  )  [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, str, and PC3::stream().

Referenced by afm_parser_next_key(), and afm_parser_read_vals().

static char* afm_stream_read_string ( AFM_Stream  stream  )  [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, str, and PC3::stream().

Referenced by afm_parser_next_key(), and afm_parser_read_vals().

static int afm_stream_skip_spaces ( AFM_Stream  stream  )  [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, AFM_STREAM_STATUS_EOL, and PC3::stream().

Referenced by afm_stream_read_one(), and afm_stream_read_string().

static AFM_Token afm_tokenize ( const char *  key,
FT_Offset  len 
) [static]

Definition at line 499 of file afmparse.c.

References afm_key_table, AFM_TOKEN_UNKNOWN, ft_strncmp, n, 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().


Variable Documentation

const char* const afm_key_table[N_AFM_TOKENS] [static]

Definition at line 280 of file afmparse.c.

Referenced by afm_tokenize().


Generated on Tue Jul 5 15:58:24 2011 for ROOT_528-00b_version by  doxygen 1.5.1