19 #include FT_FREETYPE_H 20 #include FT_INTERNAL_DEBUG_H 21 #include FT_INTERNAL_POSTSCRIPT_AUX_H 46 typedef struct AFM_StreamRec_
63 #define AFM_IS_NEWLINE( ch ) ( (ch) == '\r' || (ch) == '\n' ) 65 #define AFM_IS_EOF( ch ) ( (ch) == EOF || (ch) == '\x1a' ) 66 #define AFM_IS_SPACE( ch ) ( (ch) == ' ' || (ch) == '\t' ) 69 #define AFM_IS_SEP( ch ) ( (ch) == ';' ) 72 ( ( (stream)->cursor < (stream)->limit ) ? *(stream)->cursor++ \ 75 #define AFM_STREAM_KEY_BEGIN( stream ) \ 76 (char*)( (stream)->cursor - 1 ) 78 #define AFM_STREAM_KEY_LEN( stream, key ) \ 79 ( (char*)(stream)->cursor - key - 1 ) 81 #define AFM_STATUS_EOC( stream ) \ 82 ( (stream)->status >= AFM_STREAM_STATUS_EOC ) 84 #define AFM_STATUS_EOL( stream ) \ 85 ( (stream)->status >= AFM_STREAM_STATUS_EOL ) 87 #define AFM_STATUS_EOF( stream ) \ 88 ( (stream)->status >= AFM_STREAM_STATUS_EOF ) 126 afm_stream_skip_spaces( stream );
166 afm_stream_skip_spaces( stream );
289 "BlendDesignPositions",
341 "UnderlineThickness",
380 for (
i = 0;
i <
n;
i++ )
387 str = afm_stream_read_string(
stream );
389 str = afm_stream_read_one(
stream );
408 val->
u.
s[
len] =
'\0';
429 if ( parser->get_index )
430 val->
u.
i = parser->get_index( str, len, parser->user_data );
456 afm_stream_read_string(
stream );
459 key = afm_stream_read_one(
stream );
476 afm_stream_read_one(
stream );
479 key = afm_stream_read_one(
stream );
500 afm_tokenize(
const char* key,
508 if ( *( afm_key_table[n] ) == *key )
512 if ( *( afm_key_table[n] ) != *key )
515 if (
ft_strncmp( afm_key_table[n], key, len ) == 0 )
544 parser->memory = memory;
546 parser->FontInfo =
NULL;
547 parser->get_index =
NULL;
611 switch ( afm_tokenize( key, len ) )
657 #define KERN_INDEX( g1, g2 ) ( ( (FT_ULong)g1 << 16 ) | g2 ) 672 if ( index1 > index2 )
674 else if ( index1 < index2 )
706 AFM_Token token = afm_tokenize( key, len );
739 kp->
y = shared_vals[2].
u.
i;
743 kp->
x = shared_vals[2].
u.
i;
745 ? shared_vals[3].u.
i : 0;
782 switch ( afm_tokenize( key, len ) )
785 error = afm_parse_track_kern( parser );
792 error = afm_parse_kern_pairs( parser );
832 AFM_Token token = afm_tokenize( key, len );
856 return FT_THROW( Invalid_Argument );
859 if ( !key ||
len != 16 ||
860 ft_strncmp( key,
"StartFontMetrics", 16 ) != 0 )
861 return FT_THROW( Unknown_File_Format );
868 switch ( afm_tokenize( key,
len ) )
874 if ( metrics_sets != 0 && metrics_sets != 2 )
928 error = afm_parser_skip_section( parser, n,
936 error = afm_parse_kern_data( parser );
#define AFM_STATUS_EOC(stream)
struct AFM_KernPairRec_ * AFM_KernPair
GLboolean GLboolean GLboolean GLboolean a
struct AFM_StreamRec_ * AFM_Stream
PS_Conv_ToFixed(FT_Byte **cursor, FT_Byte *limit, FT_Long power_ten)
afm_parser_parse(AFM_Parser parser)
return FT_THROW(Missing_Property)
#define FT_QALLOC(ptr, size)
#define FT_QNEW_ARRAY(ptr, count)
#define KERN_INDEX(g1, g2)
#define AFM_IS_NEWLINE(ch)
#define AFM_STREAM_KEY_BEGIN(stream)
afm_parser_next_key(AFM_Parser parser, FT_Bool line, FT_Offset *len)
GLboolean GLboolean GLboolean b
afm_parser_done(AFM_Parser parser)
FT_BEGIN_HEADER typedef unsigned char FT_Bool
#define AFM_STATUS_EOF(stream)
#define AFM_STATUS_EOL(stream)
GLdouble GLdouble GLdouble r
#define FT_CALLBACK_DEF(x)
afm_compare_kern_pairs(const void *a, const void *b)
typedefFT_BEGIN_HEADER struct FT_MemoryRec_ * FT_Memory
enum AFM_Token_ AFM_Token
afm_parser_read_int(AFM_Parser parser, FT_Int *aint)
union AFM_ValueRec_::@29 u
afm_parser_init(AFM_Parser parser, FT_Memory memory, FT_Byte *base, FT_Byte *limit)
struct AFM_StreamRec_ AFM_StreamRec
#define AFM_STREAM_KEY_LEN(stream, key)
PS_Conv_ToInt(FT_Byte **cursor, FT_Byte *limit)
#define AFM_MAX_ARGUMENTS
afm_parser_read_vals(AFM_Parser parser, AFM_Value vals, FT_UInt n)