Commit a1be2dce authored by David Turner's avatar David Turner
Browse files

cleaned up source code to avoid function name

conflicts with Type 1 driver(s)
parent 5ae1bad3
......@@ -40,7 +40,7 @@
LOCAL_FUNC
void CID_Done_AFM( FT_Memory memory,
T1_AFM* afm )
CID_AFM* afm )
{
FREE( afm->kern_pairs );
afm->num_pairs = 0;
......@@ -146,8 +146,8 @@
int compare_kern_pairs( const void* a,
const void* b )
{
T1_Kern_Pair* pair1 = (T1_Kern_Pair*)a;
T1_Kern_Pair* pair2 = (T1_Kern_Pair*)b;
CID_Kern_Pair* pair1 = (CID_Kern_Pair*)a;
CID_Kern_Pair* pair2 = (CID_Kern_Pair*)b;
FT_ULong index1 = KERN_INDEX( pair1->glyph1, pair1->glyph2 );
FT_ULong index2 = KERN_INDEX( pair2->glyph1, pair2->glyph2 );
......@@ -168,9 +168,9 @@
FT_Byte* limit;
FT_Byte* p;
FT_Int count = 0;
T1_Kern_Pair* pair;
CID_Kern_Pair* pair;
T1_Font* type1 = &((T1_Face)t1_face)->type1;
T1_AFM* afm = 0;
CID_AFM* afm = 0;
if ( ACCESS_Frame( stream->size ) )
......@@ -195,7 +195,7 @@
/* allocate the pairs */
if ( ALLOC( afm, sizeof ( *afm ) ) ||
ALLOC_ARRAY( afm->kern_pairs, count, T1_Kern_Pair ) )
ALLOC_ARRAY( afm->kern_pairs, count, CID_Kern_Pair ) )
goto Exit;
/* now, read each kern pair */
......@@ -230,7 +230,7 @@
}
/* now, sort the kern pairs according to their glyph indices */
qsort( afm->kern_pairs, count, sizeof ( T1_Kern_Pair ),
qsort( afm->kern_pairs, count, sizeof ( CID_Kern_Pair ),
compare_kern_pairs );
Exit:
......@@ -245,12 +245,12 @@
/* find the kerning for a given glyph pair */
LOCAL_FUNC
void CID_Get_Kerning( T1_AFM* afm,
void CID_Get_Kerning( CID_AFM* afm,
FT_UInt glyph1,
FT_UInt glyph2,
FT_Vector* kerning )
{
T1_Kern_Pair *min, *mid, *max;
CID_Kern_Pair *min, *mid, *max;
FT_ULong index = KERN_INDEX( glyph1, glyph2 );
......
......@@ -22,20 +22,20 @@
#include <cidobjs.h>
typedef struct T1_Kern_Pair_
typedef struct CID_Kern_Pair_
{
FT_UInt glyph1;
FT_UInt glyph2;
FT_Vector kerning;
} T1_Kern_Pair;
} CID_Kern_Pair;
typedef struct T1_AFM_
typedef struct CID_AFM_
{
FT_Int num_pairs;
T1_Kern_Pair* kern_pairs;
CID_Kern_Pair* kern_pairs;
} T1_AFM;
} CID_AFM;
#if 1
......@@ -46,10 +46,10 @@
LOCAL_DEF
void CID_Done_AFM( FT_Memory memory,
T1_AFM* afm );
CID_AFM* afm );
LOCAL_DEF
void CID_Get_Kerning( T1_AFM* afm,
void CID_Get_Kerning( CID_AFM* afm,
FT_UInt glyph1,
FT_UInt glyph2,
FT_Vector* kerning );
......
......@@ -38,7 +38,7 @@
FT_UInt glyph_index );
typedef enum T1_Operator_
typedef enum CID_Operator_
{
op_none = 0,
......@@ -74,7 +74,7 @@
op_max /* never remove this one */
} T1_Operator;
} CID_Operator;
static const FT_Int t1_args_count[op_max] =
{
......@@ -145,8 +145,8 @@
LOCAL_FUNC
void CID_Init_Builder( CID_Builder* builder,
CID_Face face,
T1_Size size,
T1_GlyphSlot glyph )
CID_Size size,
CID_GlyphSlot glyph )
{
builder->path_begun = 0;
builder->load_points = 1;
......@@ -200,7 +200,7 @@
LOCAL_FUNC
void CID_Done_Builder( CID_Builder* builder )
{
T1_GlyphSlot glyph = builder->glyph;
CID_GlyphSlot glyph = builder->glyph;
if ( glyph )
glyph->root.outline = *builder->base;
......@@ -586,7 +586,7 @@
while ( ip < limit )
{
FT_Int* top = decoder->top;
T1_Operator op = op_none;
CID_Operator op = op_none;
FT_Long value = 0;
......@@ -1118,7 +1118,7 @@
FT_TRACE4(( " callsubr" ));
index = top[0];
if ( index < 0 || index >= decoder->subrs->num_subrs )
if ( index < 0 || index >= (FT_Int)decoder->subrs->num_subrs )
{
FT_ERROR(( "CID_Parse_CharStrings: invalid subrs index\n" ));
goto Syntax_Error;
......@@ -1374,8 +1374,8 @@
LOCAL_FUNC
FT_Error CID_Load_Glyph( T1_GlyphSlot glyph,
T1_Size size,
FT_Error CID_Load_Glyph( CID_GlyphSlot glyph,
CID_Size size,
FT_Int glyph_index,
FT_Int load_flags )
{
......
......@@ -82,7 +82,7 @@
{
FT_Memory memory;
CID_Face face;
T1_GlyphSlot glyph;
CID_GlyphSlot glyph;
FT_GlyphLoader* loader;
FT_Outline* base;
FT_Outline* current;
......@@ -144,8 +144,8 @@
LOCAL_DEF
void CID_Init_Builder( CID_Builder* builder,
CID_Face face,
T1_Size size,
T1_GlyphSlot glyph );
CID_Size size,
CID_GlyphSlot glyph );
LOCAL_DEF
void CID_Done_Builder( CID_Builder* builder );
......@@ -171,8 +171,8 @@
FT_Int charstring_len );
LOCAL_DEF
FT_Error CID_Load_Glyph( T1_GlyphSlot glyph,
T1_Size size,
FT_Error CID_Load_Glyph( CID_GlyphSlot glyph,
CID_Size size,
FT_Int glyph_index,
FT_Int load_flags );
......
......@@ -85,7 +85,7 @@
static
FT_Error cid_load_keyword( CID_Face face,
CID_Loader* loader,
const T1_Field_Rec* keyword )
const CID_Field_Rec* keyword )
{
FT_Error error;
CID_Parser* parser = &loader->parser;
......@@ -233,10 +233,10 @@
static
const T1_Field_Rec t1_field_records[] =
const CID_Field_Rec t1_field_records[] =
{
#include <cidtokens.h>
{ 0, 0, 0, 0, 0, 0 }
{ 0, 0, 0, 0, 0, 0, 0, 0 }
};
......@@ -310,7 +310,7 @@
if ( len > 0 && len < 22 )
{
/* now, compare the immediate name to the keyword table */
const T1_Field_Rec* keyword = t1_field_records;
const CID_Field_Rec* keyword = t1_field_records;
for (;;)
......@@ -363,7 +363,7 @@
FT_Memory memory = face->root.memory;
FT_Stream stream = face->root.stream;
FT_Error error;
FT_UInt n;
FT_Int n;
CID_Subrs* subr;
FT_UInt max_offsets = 0;
FT_ULong* offsets = 0;
......
......@@ -231,7 +231,7 @@
FT_Int max_advance;
error = T1_Compute_Max_Advance( face, &max_advance );
error = CID_Compute_Max_Advance( face, &max_advance );
/* in case of error, keep the standard width */
if ( !error )
......@@ -340,7 +340,7 @@
/* FreeType error code. 0 means success. */
/* */
LOCAL_FUNC
FT_Error CID_Init_Driver( T1_Driver driver )
FT_Error CID_Init_Driver( CID_Driver driver )
{
UNUSED( driver );
......@@ -360,7 +360,7 @@
/* driver :: A handle to the target CID driver. */
/* */
LOCAL_DEF
void CID_Done_Driver( T1_Driver driver )
void CID_Done_Driver( CID_Driver driver )
{
UNUSED( driver );
}
......
......@@ -31,47 +31,47 @@
/* The following structures must be defined by the hinter */
typedef struct T1_Size_Hints_ T1_Size_Hints;
typedef struct T1_Glyph_Hints_ T1_Glyph_Hints;
typedef struct CID_Size_Hints_ CID_Size_Hints;
typedef struct CID_Glyph_Hints_ CID_Glyph_Hints;
/*************************************************************************/
/* */
/* <Type> */
/* T1_Driver */
/* CID_Driver */
/* */
/* <Description> */
/* A handle to a Type 1 driver object. */
/* */
typedef struct T1_DriverRec_* T1_Driver;
typedef struct CID_DriverRec_* CID_Driver;
/*************************************************************************/
/* */
/* <Type> */
/* T1_Size */
/* CID_Size */
/* */
/* <Description> */
/* A handle to a Type 1 size object. */
/* */
typedef struct T1_SizeRec_* T1_Size;
typedef struct CID_SizeRec_* CID_Size;
/*************************************************************************/
/* */
/* <Type> */
/* T1_GlyphSlot */
/* CID_GlyphSlot */
/* */
/* <Description> */
/* A handle to a Type 1 glyph slot object. */
/* */
typedef struct T1_GlyphSlotRec_* T1_GlyphSlot;
typedef struct CID_GlyphSlotRec_* CID_GlyphSlot;
/*************************************************************************/
/* */
/* <Type> */
/* T1_CharMap */
/* CID_CharMap */
/* */
/* <Description> */
/* A handle to a Type 1 character mapping object. */
......@@ -81,7 +81,7 @@
/* The driver is responsible for making up charmap objects */
/* corresponding to these tables. */
/* */
typedef struct T1_CharMapRec_* T1_CharMap;
typedef struct CID_CharMapRec_* CID_CharMap;
/*************************************************************************/
......@@ -91,15 +91,15 @@
/*************************************************************************/
typedef struct T1_SizeRec_
typedef struct CID_SizeRec_
{
FT_SizeRec root;
FT_Bool valid;
} T1_SizeRec;
} CID_SizeRec;
typedef struct T1_GlyphSlotRec_
typedef struct CID_GlyphSlotRec_
{
FT_GlyphSlotRec root;
......@@ -109,7 +109,7 @@
FT_Fixed x_scale;
FT_Fixed y_scale;
} T1_GlyphSlotRec;
} CID_GlyphSlotRec;
LOCAL_DEF
......@@ -124,10 +124,10 @@
LOCAL_DEF
FT_Error CID_Init_Driver( T1_Driver driver );
FT_Error CID_Init_Driver( CID_Driver driver );
LOCAL_DEF
void CID_Done_Driver( T1_Driver driver );
void CID_Done_Driver( CID_Driver driver );
#ifdef __cplusplus
......
......@@ -42,7 +42,7 @@
/*************************************************************************/
/*************************************************************************/
/***** *****/
/***** IMPLEMENTATION OF T1_TABLE OBJECT *****/
/***** IMPLEMENTATION OF CID_TABLE OBJECT *****/
/***** *****/
/*************************************************************************/
/*************************************************************************/
......@@ -52,10 +52,10 @@
/*************************************************************************/
/* */
/* <Function> */
/* T1_New_Table */
/* CID_New_Table */
/* */
/* <Description> */
/* Initializes a T1_Table. */
/* Initializes a CID_Table. */
/* */
/* <InOut> */
/* table :: The address of the target table. */
......@@ -70,7 +70,7 @@
/* FreeType error code. 0 means success. */
/* */
LOCAL_FUNC
FT_Error T1_New_Table( T1_Table* table,
FT_Error CID_New_Table( CID_Table* table,
FT_Int count,
FT_Memory memory )
{
......@@ -98,7 +98,7 @@
static
void shift_elements( T1_Table* table,
void shift_elements( CID_Table* table,
FT_Byte* old_base )
{
FT_Long delta = table->block - old_base;
......@@ -116,7 +116,7 @@
static
FT_Error reallocate_t1_table( T1_Table* table,
FT_Error reallocate_t1_table( CID_Table* table,
FT_Int new_size )
{
FT_Memory memory = table->memory;
......@@ -141,10 +141,10 @@
/*************************************************************************/
/* */
/* <Function> */
/* T1_Add_Table */
/* CID_Add_Table */
/* */
/* <Description> */
/* Adds an object to a T1_Table, possibly growing its memory block. */
/* Adds an object to a CID_Table, possibly growing its memory block. */
/* */
/* <InOut> */
/* table :: The target table. */
......@@ -161,14 +161,14 @@
/* reallocation fails. */
/* */
LOCAL_FUNC
FT_Error T1_Add_Table( T1_Table* table,
FT_Error CID_Add_Table( CID_Table* table,
FT_Int index,
void* object,
FT_Int length )
{
if ( index < 0 || index > table->max_elems )
{
FT_ERROR(( "T1_Add_Table: invalid index\n" ));
FT_ERROR(( "CID_Add_Table: invalid index\n" ));
return T1_Err_Syntax_Error;
}
......@@ -202,10 +202,10 @@
/*************************************************************************/
/* */
/* <Function> */
/* T1_Done_Table */
/* CID_Done_Table */
/* */
/* <Description> */
/* Finalizes a T1_Table (reallocate it to its current cursor). */
/* Finalizes a CID_Table (reallocate it to its current cursor). */
/* */
/* <InOut> */
/* table :: The target table. */
......@@ -215,7 +215,7 @@
/* to the caller to clean it, or reference it in its own structures. */
/* */
LOCAL_FUNC
void T1_Done_Table( T1_Table* table )
void CID_Done_Table( CID_Table* table )
{
FT_Memory memory = table->memory;
FT_Error error;
......@@ -236,7 +236,7 @@
LOCAL_FUNC
void T1_Release_Table( T1_Table* table )
void CID_Release_Table( CID_Table* table )
{
FT_Memory memory = table->memory;
......@@ -264,10 +264,10 @@
/*************************************************************************/
#define IS_T1_WHITESPACE( c ) ( (c) == ' ' || (c) == '\t' )
#define IS_T1_LINESPACE( c ) ( (c) == '\r' || (c) == '\n' )
#define IS_CID_WHITESPACE( c ) ( (c) == ' ' || (c) == '\t' )
#define IS_CID_LINESPACE( c ) ( (c) == '\r' || (c) == '\n' )
#define IS_T1_SPACE( c ) ( IS_T1_WHITESPACE( c ) || IS_T1_LINESPACE( c ) )
#define IS_CID_SPACE( c ) ( IS_CID_WHITESPACE( c ) || IS_CID_LINESPACE( c ) )
LOCAL_FUNC
......@@ -282,7 +282,7 @@
FT_Byte c = *cur;
if ( !IS_T1_SPACE( c ) )
if ( !IS_CID_SPACE( c ) )
break;
cur++;
}
......@@ -293,7 +293,7 @@
LOCAL_FUNC
void CID_ToToken( CID_Parser* parser,
T1_Token_Rec* token )
CID_Token_Rec* token )
{
FT_Byte* cur;
FT_Byte* limit;
......@@ -358,7 +358,7 @@
default:
token->start = cur++;
token->type = t1_token_any;
while ( cur < limit && !IS_T1_SPACE( *cur ) )
while ( cur < limit && !IS_CID_SPACE( *cur ) )
cur++;
token->limit = cur;
......@@ -377,11 +377,11 @@
LOCAL_FUNC
void CID_ToTokenArray( CID_Parser* parser,
T1_Token_Rec* tokens,
CID_Token_Rec* tokens,
FT_UInt max_tokens,
FT_Int* pnum_tokens )
{
T1_Token_Rec master;
CID_Token_Rec master;
*pnum_tokens = -1;
......@@ -392,8 +392,8 @@
{
FT_Byte* old_cursor = parser->cursor;
FT_Byte* old_limit = parser->limit;
T1_Token_Rec* cur = tokens;
T1_Token_Rec* limit = cur + max_tokens;
CID_Token_Rec* cur = tokens;
CID_Token_Rec* limit = cur + max_tokens;
parser->cursor = master.start;
......@@ -401,7 +401,7 @@
while ( parser->cursor < parser->limit )
{
T1_Token_Rec token;
CID_Token_Rec token;
CID_ToToken( parser, &token );
......@@ -711,10 +711,10 @@
/* list of objects */
LOCAL_FUNC
FT_Error CID_Load_Field( CID_Parser* parser,
const T1_Field_Rec* field,
const CID_Field_Rec* field,
void* object )
{
T1_Token_Rec token;
CID_Token_Rec token;
FT_Byte* cur;
FT_Byte* limit;
FT_UInt count;
......@@ -799,21 +799,21 @@
}
#define CID_MAX_TABLE_ELEMENTS 32
#define T1_MAX_TABLE_ELEMENTS 32
LOCAL_FUNC
FT_Error CID_Load_Field_Table( CID_Parser* parser,
const T1_Field_Rec* field,
const CID_Field_Rec* field,
void* object )
{
T1_Token_Rec elements[CID_MAX_TABLE_ELEMENTS];
T1_Token_Rec* token;
CID_Token_Rec elements[T1_MAX_TABLE_ELEMENTS];
CID_Token_Rec* token;
FT_Int num_elements;
FT_Error error = 0;
FT_Byte* old_cursor;
FT_Byte* old_limit;
T1_Field_Rec fieldrec = *(T1_Field_Rec*)field;
CID_Field_Rec fieldrec = *(CID_Field_Rec*)field;
fieldrec.type = t1_field_integer;
......@@ -824,8 +824,8 @@
if ( num_elements < 0 )
goto Fail;
if ( num_elements > CID_MAX_TABLE_ELEMENTS )
num_elements = CID_MAX_TABLE_ELEMENTS;
if ( num_elements > T1_MAX_TABLE_ELEMENTS )
num_elements = T1_MAX_TABLE_ELEMENTS;
old_cursor = parser->cursor;
old_limit = parser->limit;
......
......@@ -32,10 +32,10 @@
/*************************************************************************/
/* */
/* <Struct> */
/* T1_Table */
/* CID_Table */
/* */
/* <Description> */
/* A T1_Table is a simple object used to store an array of objects */
/* A CID_Table is a simple object used to store an array of objects */
/* in a single memory block. */
/* */
/* <Fields> */
......@@ -62,7 +62,7 @@
/* memory :: The memory object used for memory operations */
/* (allocation resp. reallocation). */
/* */
typedef struct T1_Table_
typedef struct CID_Table_
{
FT_Byte* block; /* current memory block */
FT_Int cursor; /* current cursor in memory block */
......@@ -76,22 +76,22 @@
FT_Memory memory;
} T1_Table;
} CID_Table;
LOCAL_DEF
FT_Error T1_New_Table( T1_Table* table,
FT_Error CID_New_Table( CID_Table* table,
FT_Int count,
T1_Memory memory );
CID_Memory memory );
LOCAL_DEF
FT_Error T1_Add_Table( T1_Table* table,
FT_Error CID_Add_Table( CID_Table* table,
FT_Int index,
void* object,
FT_Int length );
LOCAL_DEF
void T1_Release_Table( T1_Table* table );
void CID_Release_Table( CID_Table* table );
#endif /* 0 */
......@@ -183,7 +183,7 @@
/* simple enumeration type used to identify token types */
typedef enum T1_Token_Type_