Visualization Library 2.0.0-b5

A lightweight C++ OpenGL middleware for 2D/3D graphics

VL     Star     Watch     Fork     Issue

[Download] [Tutorials] [All Classes] [Grouped Classes]
Macros | Typedefs | Enumerations | Functions
afmparse.c File Reference
#include <ft2build.h>
#include "afmparse.h"
#include "psconv.h"
#include "psauxerr.h"

Go to the source code of this file.

Macros

#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 struct AFM_StreamRec_ AFM_StreamRec
 
typedef enum AFM_Token_ AFM_Token
 

Enumerations

enum  { AFM_STREAM_STATUS_NORMAL, AFM_STREAM_STATUS_EOC, AFM_STREAM_STATUS_EOL, AFM_STREAM_STATUS_EOF }
 
enum  AFM_Token_ {
  AFM_TOKEN_ASCENDER, AFM_TOKEN_AXISLABEL, AFM_TOKEN_AXISTYPE, AFM_TOKEN_B,
  AFM_TOKEN_BLENDAXISTYPES, AFM_TOKEN_BLENDDESIGNMAP, AFM_TOKEN_BLENDDESIGNPOSITIONS, AFM_TOKEN_C,
  AFM_TOKEN_CC, AFM_TOKEN_CH, AFM_TOKEN_CAPHEIGHT, AFM_TOKEN_CHARWIDTH,
  AFM_TOKEN_CHARACTERSET, AFM_TOKEN_CHARACTERS, AFM_TOKEN_DESCENDER, AFM_TOKEN_ENCODINGSCHEME,
  AFM_TOKEN_ENDAXIS, AFM_TOKEN_ENDCHARMETRICS, AFM_TOKEN_ENDCOMPOSITES, AFM_TOKEN_ENDDIRECTION,
  AFM_TOKEN_ENDFONTMETRICS, AFM_TOKEN_ENDKERNDATA, AFM_TOKEN_ENDKERNPAIRS, AFM_TOKEN_ENDTRACKKERN,
  AFM_TOKEN_ESCCHAR, AFM_TOKEN_FAMILYNAME, AFM_TOKEN_FONTBBOX, AFM_TOKEN_FONTNAME,
  AFM_TOKEN_FULLNAME, AFM_TOKEN_ISBASEFONT, AFM_TOKEN_ISCIDFONT, AFM_TOKEN_ISFIXEDPITCH,
  AFM_TOKEN_ISFIXEDV, AFM_TOKEN_ITALICANGLE, AFM_TOKEN_KP, AFM_TOKEN_KPH,
  AFM_TOKEN_KPX, AFM_TOKEN_KPY, AFM_TOKEN_L, AFM_TOKEN_MAPPINGSCHEME,
  AFM_TOKEN_METRICSSETS, AFM_TOKEN_N, AFM_TOKEN_NOTICE, AFM_TOKEN_PCC,
  AFM_TOKEN_STARTAXIS, AFM_TOKEN_STARTCHARMETRICS, AFM_TOKEN_STARTCOMPOSITES, AFM_TOKEN_STARTDIRECTION,
  AFM_TOKEN_STARTFONTMETRICS, AFM_TOKEN_STARTKERNDATA, AFM_TOKEN_STARTKERNPAIRS, AFM_TOKEN_STARTKERNPAIRS0,
  AFM_TOKEN_STARTKERNPAIRS1, AFM_TOKEN_STARTTRACKKERN, AFM_TOKEN_STDHW, AFM_TOKEN_STDVW,
  AFM_TOKEN_TRACKKERN, AFM_TOKEN_UNDERLINEPOSITION, AFM_TOKEN_UNDERLINETHICKNESS, AFM_TOKEN_VV,
  AFM_TOKEN_VVECTOR, AFM_TOKEN_VERSION, AFM_TOKEN_W, AFM_TOKEN_W0,
  AFM_TOKEN_W0X, AFM_TOKEN_W0Y, AFM_TOKEN_W1, AFM_TOKEN_W1X,
  AFM_TOKEN_W1Y, AFM_TOKEN_WX, AFM_TOKEN_WY, AFM_TOKEN_WEIGHT,
  AFM_TOKEN_WEIGHTVECTOR, AFM_TOKEN_XHEIGHT, N_AFM_TOKENS, AFM_TOKEN_UNKNOWN
}
 

Functions

 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)
 
 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)
 
 afm_compare_kern_pairs (const void *a, const void *b)
 
 afm_parser_parse (AFM_Parser parser)
 

Macro Definition Documentation

◆ AFM_GETC

#define AFM_GETC ( )
Value:
( ( (stream)->cursor < (stream)->limit ) ? *(stream)->cursor++ \
: EOF )
GLuint GLuint stream
#define EOF
Definition: afmparse.c:58

Definition at line 71 of file afmparse.c.

◆ AFM_IS_EOF

#define AFM_IS_EOF (   ch)    ( (ch) == EOF || (ch) == '\x1a' )

Definition at line 65 of file afmparse.c.

◆ AFM_IS_NEWLINE

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

Definition at line 63 of file afmparse.c.

◆ AFM_IS_SEP

#define AFM_IS_SEP (   ch)    ( (ch) == ';' )

Definition at line 69 of file afmparse.c.

◆ AFM_IS_SPACE

#define AFM_IS_SPACE (   ch)    ( (ch) == ' ' || (ch) == '\t' )

Definition at line 66 of file afmparse.c.

◆ AFM_STATUS_EOC

#define AFM_STATUS_EOC (   stream)    ( (stream)->status >= AFM_STREAM_STATUS_EOC )

Definition at line 81 of file afmparse.c.

◆ AFM_STATUS_EOF

#define AFM_STATUS_EOF (   stream)    ( (stream)->status >= AFM_STREAM_STATUS_EOF )

Definition at line 87 of file afmparse.c.

◆ AFM_STATUS_EOL

#define AFM_STATUS_EOL (   stream)    ( (stream)->status >= AFM_STREAM_STATUS_EOL )

Definition at line 84 of file afmparse.c.

Referenced by afm_parser_next_key().

◆ AFM_STREAM_KEY_BEGIN

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

Definition at line 75 of file afmparse.c.

◆ AFM_STREAM_KEY_LEN

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

Definition at line 78 of file afmparse.c.

◆ EOF

#define EOF   -1

◆ KERN_INDEX

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

Definition at line 657 of file afmparse.c.

Referenced by afm_compare_kern_pairs().

Typedef Documentation

◆ AFM_StreamRec

typedef struct AFM_StreamRec_ AFM_StreamRec

◆ AFM_Token

typedef enum AFM_Token_ AFM_Token

Enumeration Type Documentation

◆ anonymous enum

anonymous enum
Enumerator
AFM_STREAM_STATUS_NORMAL 
AFM_STREAM_STATUS_EOC 
AFM_STREAM_STATUS_EOL 
AFM_STREAM_STATUS_EOF 

Definition at line 37 of file afmparse.c.

◆ AFM_Token_

enum AFM_Token_
Enumerator
AFM_TOKEN_ASCENDER 
AFM_TOKEN_AXISLABEL 
AFM_TOKEN_AXISTYPE 
AFM_TOKEN_B 
AFM_TOKEN_BLENDAXISTYPES 
AFM_TOKEN_BLENDDESIGNMAP 
AFM_TOKEN_BLENDDESIGNPOSITIONS 
AFM_TOKEN_C 
AFM_TOKEN_CC 
AFM_TOKEN_CH 
AFM_TOKEN_CAPHEIGHT 
AFM_TOKEN_CHARWIDTH 
AFM_TOKEN_CHARACTERSET 
AFM_TOKEN_CHARACTERS 
AFM_TOKEN_DESCENDER 
AFM_TOKEN_ENCODINGSCHEME 
AFM_TOKEN_ENDAXIS 
AFM_TOKEN_ENDCHARMETRICS 
AFM_TOKEN_ENDCOMPOSITES 
AFM_TOKEN_ENDDIRECTION 
AFM_TOKEN_ENDFONTMETRICS 
AFM_TOKEN_ENDKERNDATA 
AFM_TOKEN_ENDKERNPAIRS 
AFM_TOKEN_ENDTRACKKERN 
AFM_TOKEN_ESCCHAR 
AFM_TOKEN_FAMILYNAME 
AFM_TOKEN_FONTBBOX 
AFM_TOKEN_FONTNAME 
AFM_TOKEN_FULLNAME 
AFM_TOKEN_ISBASEFONT 
AFM_TOKEN_ISCIDFONT 
AFM_TOKEN_ISFIXEDPITCH 
AFM_TOKEN_ISFIXEDV 
AFM_TOKEN_ITALICANGLE 
AFM_TOKEN_KP 
AFM_TOKEN_KPH 
AFM_TOKEN_KPX 
AFM_TOKEN_KPY 
AFM_TOKEN_L 
AFM_TOKEN_MAPPINGSCHEME 
AFM_TOKEN_METRICSSETS 
AFM_TOKEN_N 
AFM_TOKEN_NOTICE 
AFM_TOKEN_PCC 
AFM_TOKEN_STARTAXIS 
AFM_TOKEN_STARTCHARMETRICS 
AFM_TOKEN_STARTCOMPOSITES 
AFM_TOKEN_STARTDIRECTION 
AFM_TOKEN_STARTFONTMETRICS 
AFM_TOKEN_STARTKERNDATA 
AFM_TOKEN_STARTKERNPAIRS 
AFM_TOKEN_STARTKERNPAIRS0 
AFM_TOKEN_STARTKERNPAIRS1 
AFM_TOKEN_STARTTRACKKERN 
AFM_TOKEN_STDHW 
AFM_TOKEN_STDVW 
AFM_TOKEN_TRACKKERN 
AFM_TOKEN_UNDERLINEPOSITION 
AFM_TOKEN_UNDERLINETHICKNESS 
AFM_TOKEN_VV 
AFM_TOKEN_VVECTOR 
AFM_TOKEN_VERSION 
AFM_TOKEN_W 
AFM_TOKEN_W0 
AFM_TOKEN_W0X 
AFM_TOKEN_W0Y 
AFM_TOKEN_W1 
AFM_TOKEN_W1X 
AFM_TOKEN_W1Y 
AFM_TOKEN_WX 
AFM_TOKEN_WY 
AFM_TOKEN_WEIGHT 
AFM_TOKEN_WEIGHTVECTOR 
AFM_TOKEN_XHEIGHT 
N_AFM_TOKENS 
AFM_TOKEN_UNKNOWN 

Definition at line 199 of file afmparse.c.

Function Documentation

◆ afm_compare_kern_pairs()

afm_compare_kern_pairs ( const void a,
const void b 
)

Definition at line 662 of file afmparse.c.

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

◆ afm_parser_done()

afm_parser_done ( AFM_Parser  parser)

Definition at line 554 of file afmparse.c.

References FT_FREE, and FT_LOCAL_DEF.

◆ afm_parser_init()

afm_parser_init ( AFM_Parser  parser,
FT_Memory  memory,
FT_Byte base,
FT_Byte limit 
)

Definition at line 526 of file afmparse.c.

References AFM_STREAM_STATUS_EOL, error, FT_Err_Ok, FT_LOCAL, FT_NEW, and NULL.

◆ afm_parser_next_key()

afm_parser_next_key ( AFM_Parser  parser,
FT_Bool  line,
FT_Offset len 
)

Definition at line 442 of file afmparse.c.

References AFM_STATUS_EOL.

Referenced by afm_parser_parse().

◆ afm_parser_parse()

afm_parser_parse ( AFM_Parser  parser)

◆ afm_parser_read_int()

afm_parser_read_int ( AFM_Parser  parser,
FT_Int aint 
)

◆ afm_parser_read_vals()

afm_parser_read_vals ( AFM_Parser  parser,
AFM_Value  vals,
FT_UInt  n 
)

Definition at line 368 of file afmparse.c.

References AFM_MAX_ARGUMENTS, AFM_VALUE_TYPE_STRING, i, and AFM_ValueRec_::type.

Referenced by afm_parser_read_int().