ref: a1be2dcee38dd4448a365fd8932c52cca52f5445
parent: 5ae1bad3f6f1c842a6f87d8c6e1e5c0237eb236b
author: David Turner <[email protected]>
date: Tue Jun 27 19:20:35 EDT 2000
cleaned up source code to avoid function name conflicts with Type 1 driver(s)
--- a/src/cid/cidafm.c
+++ b/src/cid/cidafm.c
@@ -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 );
--- a/src/cid/cidafm.h
+++ b/src/cid/cidafm.h
@@ -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 );
--- a/src/cid/cidgload.c
+++ b/src/cid/cidgload.c
@@ -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 )
{
--- a/src/cid/cidgload.h
+++ b/src/cid/cidgload.h
@@ -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 );
--- a/src/cid/cidload.c
+++ b/src/cid/cidload.c
@@ -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;
--- a/src/cid/cidobjs.c
+++ b/src/cid/cidobjs.c
@@ -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 );
}
--- a/src/cid/cidobjs.h
+++ b/src/cid/cidobjs.h
@@ -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
--- a/src/cid/cidparse.c
+++ b/src/cid/cidparse.c
@@ -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,7 +161,7 @@
/* 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 )
@@ -168,7 +168,7 @@
{
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;
--- a/src/cid/cidparse.h
+++ b/src/cid/cidparse.h
@@ -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_
+ typedef enum CID_Token_Type_
{
t1_token_none = 0,
t1_token_any,
@@ -193,26 +193,26 @@
/* do not remove */
t1_token_max
- } T1_Token_Type;
+ } CID_Token_Type;
/* a simple structure used to identify tokens */
- typedef struct T1_Token_Rec_
+ typedef struct CID_Token_Rec_
{
FT_Byte* start; /* first character of token in input stream */
FT_Byte* limit; /* first character after the token */
- T1_Token_Type type; /* type of token.. */
+ CID_Token_Type type; /* type of token.. */
- } T1_Token_Rec;
+ } CID_Token_Rec;
LOCAL_DEF
void CID_ToToken( CID_Parser* parser,
- T1_Token_Rec* token );
+ CID_Token_Rec* token );
/* enumeration type used to identify object fields */
- typedef enum T1_Field_Type_
+ typedef enum CID_Field_Type_
{
t1_field_none = 0,
t1_field_bool,
@@ -226,9 +226,9 @@
/* do not remove */
t1_field_max
- } T1_Field_Type;
+ } CID_Field_Type;
- typedef enum T1_Field_Location_
+ typedef enum CID_Field_Location_
{
t1_field_cid_info,
t1_field_font_dict,
@@ -238,7 +238,7 @@
/* do not remove */
t1_field_location_max
- } T1_Field_Location;
+ } CID_Field_Location;
typedef FT_Error (*CID_Field_Parser)( CID_Face face,
@@ -245,11 +245,11 @@
CID_Parser* parser );
/* structure type used to model object fields */
- typedef struct T1_Field_Rec_
+ typedef struct CID_Field_Rec_
{
const char* ident; /* field identifier */
- T1_Field_Location location;
- T1_Field_Type type; /* type of field */
+ CID_Field_Location location;
+ CID_Field_Type type; /* type of field */
CID_Field_Parser reader;
FT_UInt offset; /* offset of field in object */
FT_UInt size; /* size of field in bytes */
@@ -257,21 +257,21 @@
/* array */
FT_UInt count_offset; /* offset of element count for */
/* arrays */
- } T1_Field_Rec;
+ } CID_Field_Rec;
-#define T1_FIELD_REF( s, f ) ( ((s*)0)->f )
+#define CID_FIELD_REF( s, f ) ( ((s*)0)->f )
-#define T1_NEW_SIMPLE_FIELD( _ident, _type, _fname ) \
+#define CID_NEW_SIMPLE_FIELD( _ident, _type, _fname ) \
{ \
_ident, T1CODE, _type, \
0, \
- (FT_UInt)(char*)&T1_FIELD_REF( T1TYPE, _fname ), \
- sizeof ( T1_FIELD_REF( T1TYPE, _fname ) ), \
+ (FT_UInt)(char*)&CID_FIELD_REF( T1TYPE, _fname ), \
+ sizeof ( CID_FIELD_REF( T1TYPE, _fname ) ), \
0, 0 \
},
-#define T1_NEW_CALLBACK_FIELD( _ident, _reader ) \
+#define CID_NEW_CALLBACK_FIELD( _ident, _reader ) \
{ \
_ident, T1CODE, t1_field_callback, \
_reader, \
@@ -279,66 +279,66 @@
0, 0 \
},
-#define T1_NEW_TABLE_FIELD( _ident, _type, _fname, _max ) \
+#define CID_NEW_TABLE_FIELD( _ident, _type, _fname, _max ) \
{ \
_ident, T1CODE, _type, \
0, \
- (FT_UInt)(char*)&T1_FIELD_REF( T1TYPE, _fname ), \
- sizeof ( T1_FIELD_REF( T1TYPE, _fname )[0] ), \
+ (FT_UInt)(char*)&CID_FIELD_REF( T1TYPE, _fname ), \
+ sizeof ( CID_FIELD_REF( T1TYPE, _fname )[0] ), \
_max, \
- (FT_UInt)(char*)&T1_FIELD_REF( T1TYPE, num_ ## _fname ) \
+ (FT_UInt)(char*)&CID_FIELD_REF( T1TYPE, num_ ## _fname ) \
},
-#define T1_NEW_TABLE_FIELD2( _ident, _type, _fname, _max ) \
+#define CID_NEW_TABLE_FIELD2( _ident, _type, _fname, _max ) \
{ \
_ident, T1CODE, _type, \
0, \
- (FT_UInt)(char*)&T1_FIELD_REF( T1TYPE, _fname ), \
- sizeof ( T1_FIELD_REF( T1TYPE, _fname )[0] ), \
+ (FT_UInt)(char*)&CID_FIELD_REF( T1TYPE, _fname ), \
+ sizeof ( CID_FIELD_REF( T1TYPE, _fname )[0] ), \
_max, 0 \
},
-#define T1_FIELD_BOOL( _ident, _fname ) \
- T1_NEW_SIMPLE_FIELD( _ident, t1_field_bool, _fname )
+#define CID_FIELD_BOOL( _ident, _fname ) \
+ CID_NEW_SIMPLE_FIELD( _ident, t1_field_bool, _fname )
-#define T1_FIELD_NUM( _ident, _fname ) \
- T1_NEW_SIMPLE_FIELD( _ident, t1_field_integer, _fname )
+#define CID_FIELD_NUM( _ident, _fname ) \
+ CID_NEW_SIMPLE_FIELD( _ident, t1_field_integer, _fname )
-#define T1_FIELD_FIXED( _ident, _fname ) \
- T1_NEW_SIMPLE_FIELD( _ident, t1_field_fixed, _fname )
+#define CID_FIELD_FIXED( _ident, _fname ) \
+ CID_NEW_SIMPLE_FIELD( _ident, t1_field_fixed, _fname )
-#define T1_FIELD_STRING( _ident, _fname ) \
- T1_NEW_SIMPLE_FIELD( _ident, t1_field_string, _fname )
+#define CID_FIELD_STRING( _ident, _fname ) \
+ CID_NEW_SIMPLE_FIELD( _ident, t1_field_string, _fname )
-#define T1_FIELD_NUM_TABLE( _ident, _fname, _fmax ) \
- T1_NEW_TABLE_FIELD( _ident, t1_field_integer_array, \
+#define CID_FIELD_NUM_TABLE( _ident, _fname, _fmax ) \
+ CID_NEW_TABLE_FIELD( _ident, t1_field_integer_array, \
_fname, _fmax )
-#define T1_FIELD_FIXED_TABLE( _ident, _fname, _fmax ) \
- T1_NEW_TABLE_FIELD( _ident, t1_field_fixed_array, \
+#define CID_FIELD_FIXED_TABLE( _ident, _fname, _fmax ) \
+ CID_NEW_TABLE_FIELD( _ident, t1_field_fixed_array, \
_fname, _fmax )
-#define T1_FIELD_NUM_TABLE2( _ident, _fname, _fmax ) \
- T1_NEW_TABLE_FIELD2( _ident, t1_field_integer_array, \
+#define CID_FIELD_NUM_TABLE2( _ident, _fname, _fmax ) \
+ CID_NEW_TABLE_FIELD2( _ident, t1_field_integer_array, \
_fname, _fmax )
-#define T1_FIELD_FIXED_TABLE2( _ident, _fname, _fmax ) \
- T1_NEW_TABLE_FIELD2( _ident, t1_field_fixed_array, \
+#define CID_FIELD_FIXED_TABLE2( _ident, _fname, _fmax ) \
+ CID_NEW_TABLE_FIELD2( _ident, t1_field_fixed_array, \
_fname, _fmax )
-#define T1_FIELD_CALLBACK( _ident, _name ) \
- T1_NEW_CALLBACK_FIELD( _ident, parse_ ## _name )
+#define CID_FIELD_CALLBACK( _ident, _name ) \
+ CID_NEW_CALLBACK_FIELD( _ident, parse_ ## _name )
LOCAL_DEF
FT_Error CID_Load_Field( CID_Parser* parser,
- const T1_Field_Rec* field,
+ const CID_Field_Rec* field,
void* object );
LOCAL_DEF
FT_Error CID_Load_Field_Table( CID_Parser* parser,
- const T1_Field_Rec* field,
+ const CID_Field_Rec* field,
void* object );
--- a/src/cid/cidriver.c
+++ b/src/cid/cidriver.c
@@ -50,7 +50,6 @@
#ifndef T1_CONFIG_OPTION_NO_AFM
-
static
FT_Error cid_Get_Kerning( T1_Face face,
FT_UInt left_glyph,
@@ -57,13 +56,13 @@
FT_UInt right_glyph,
FT_Vector* kerning )
{
- T1_AFM* afm;
+ CID_AFM* afm;
kerning->x = 0;
kerning->y = 0;
- afm = (T1_AFM*)face->afm_data;
+ afm = (CID_AFM*)face->afm_data;
if ( afm )
CID_Get_Kerning( afm, left_glyph, right_glyph, kerning );
@@ -193,8 +192,8 @@
/* then the other font drivers fields */
sizeof( CID_FaceRec ),
- sizeof( T1_SizeRec ),
- sizeof( T1_GlyphSlotRec ),
+ sizeof( CID_SizeRec ),
+ sizeof( CID_GlyphSlotRec ),
(FTDriver_initFace) CID_Init_Face,
(FTDriver_doneFace) CID_Done_Face,
--- a/src/cid/cidtokens.h
+++ b/src/cid/cidtokens.h
@@ -21,19 +21,19 @@
#define T1TYPE CID_Info
#define T1CODE t1_field_cid_info
- T1_FIELD_STRING ( "CIDFontName", cid_font_name )
- T1_FIELD_NUM ( "CIDFontVersion", cid_version )
- T1_FIELD_NUM ( "CIDFontType", cid_font_type )
- T1_FIELD_STRING ( "Registry", registry )
- T1_FIELD_STRING ( "Ordering", ordering )
- T1_FIELD_NUM ( "Supplement", supplement )
- T1_FIELD_CALLBACK( "FontBBox", font_bbox )
- T1_FIELD_NUM ( "UIDBase", uid_base )
- T1_FIELD_CALLBACK( "FDArray", fd_array )
- T1_FIELD_NUM ( "CIDMapOffset", cidmap_offset )
- T1_FIELD_NUM ( "FDBytes", fd_bytes )
- T1_FIELD_NUM ( "GDBytes", gd_bytes )
- T1_FIELD_NUM ( "CIDCount", cid_count )
+ CID_FIELD_STRING ( "CIDFontName", cid_font_name )
+ CID_FIELD_NUM ( "CIDFontVersion", cid_version )
+ CID_FIELD_NUM ( "CIDFontType", cid_font_type )
+ CID_FIELD_STRING ( "Registry", registry )
+ CID_FIELD_STRING ( "Ordering", ordering )
+ CID_FIELD_NUM ( "Supplement", supplement )
+ CID_FIELD_CALLBACK( "FontBBox", font_bbox )
+ CID_FIELD_NUM ( "UIDBase", uid_base )
+ CID_FIELD_CALLBACK( "FDArray", fd_array )
+ CID_FIELD_NUM ( "CIDMapOffset", cidmap_offset )
+ CID_FIELD_NUM ( "FDBytes", fd_bytes )
+ CID_FIELD_NUM ( "GDBytes", gd_bytes )
+ CID_FIELD_NUM ( "CIDCount", cid_count )
#undef T1TYPE
@@ -41,15 +41,15 @@
#define T1TYPE T1_FontInfo
#define T1CODE t1_field_font_info
- T1_FIELD_STRING( "version", version )
- T1_FIELD_STRING( "Notice", notice )
- T1_FIELD_STRING( "FullName", full_name )
- T1_FIELD_STRING( "FamilyName", family_name )
- T1_FIELD_STRING( "Weight", weight )
- T1_FIELD_FIXED ( "ItalicAngle", italic_angle )
- T1_FIELD_BOOL ( "isFixedPitch", is_fixed_pitch )
- T1_FIELD_NUM ( "UnderlinePosition", underline_position )
- T1_FIELD_NUM ( "UnderlineThickness", underline_thickness )
+ CID_FIELD_STRING( "version", version )
+ CID_FIELD_STRING( "Notice", notice )
+ CID_FIELD_STRING( "FullName", full_name )
+ CID_FIELD_STRING( "FamilyName", family_name )
+ CID_FIELD_STRING( "Weight", weight )
+ CID_FIELD_FIXED ( "ItalicAngle", italic_angle )
+ CID_FIELD_BOOL ( "isFixedPitch", is_fixed_pitch )
+ CID_FIELD_NUM ( "UnderlinePosition", underline_position )
+ CID_FIELD_NUM ( "UnderlineThickness", underline_thickness )
#undef T1TYPE
@@ -57,16 +57,16 @@
#define T1TYPE CID_FontDict
#define T1CODE t1_field_font_dict
- T1_FIELD_CALLBACK( "FontMatrix", font_matrix )
- T1_FIELD_NUM ( "PaintType", paint_type )
- T1_FIELD_NUM ( "FontType", font_type )
- T1_FIELD_NUM ( "SubrMapOffset", subrmap_offset )
- T1_FIELD_NUM ( "SDBytes", sd_bytes )
- T1_FIELD_NUM ( "SubrCount", num_subrs )
- T1_FIELD_NUM ( "lenBuildCharArray", len_buildchar )
- T1_FIELD_FIXED ( "ForceBoldThreshold", forcebold_threshold )
- T1_FIELD_FIXED ( "ExpansionFactor", expansion_factor )
- T1_FIELD_NUM ( "StrokeWidth", stroke_width )
+ CID_FIELD_CALLBACK( "FontMatrix", font_matrix )
+ CID_FIELD_NUM ( "PaintType", paint_type )
+ CID_FIELD_NUM ( "FontType", font_type )
+ CID_FIELD_NUM ( "SubrMapOffset", subrmap_offset )
+ CID_FIELD_NUM ( "SDBytes", sd_bytes )
+ CID_FIELD_NUM ( "SubrCount", num_subrs )
+ CID_FIELD_NUM ( "lenBuildCharArray", len_buildchar )
+ CID_FIELD_FIXED ( "ForceBoldThreshold", forcebold_threshold )
+ CID_FIELD_FIXED ( "ExpansionFactor", expansion_factor )
+ CID_FIELD_NUM ( "StrokeWidth", stroke_width )
#undef T1TYPE
@@ -74,26 +74,26 @@
#define T1TYPE T1_Private
#define T1CODE t1_field_private
- T1_FIELD_NUM ( "UniqueID", unique_id )
- T1_FIELD_NUM ( "lenIV", lenIV )
- T1_FIELD_NUM ( "LanguageGroup", language_group )
- T1_FIELD_NUM ( "password", password )
+ CID_FIELD_NUM ( "UniqueID", unique_id )
+ CID_FIELD_NUM ( "lenIV", lenIV )
+ CID_FIELD_NUM ( "LanguageGroup", language_group )
+ CID_FIELD_NUM ( "password", password )
- T1_FIELD_FIXED ( "BlueScale", blue_scale )
- T1_FIELD_NUM ( "BlueShift", blue_shift )
- T1_FIELD_NUM ( "BlueFuzz", blue_fuzz )
+ CID_FIELD_FIXED ( "BlueScale", blue_scale )
+ CID_FIELD_NUM ( "BlueShift", blue_shift )
+ CID_FIELD_NUM ( "BlueFuzz", blue_fuzz )
- T1_FIELD_NUM_TABLE( "BlueValues", blue_values, 14 )
- T1_FIELD_NUM_TABLE( "OtherBlues", other_blues, 10 )
- T1_FIELD_NUM_TABLE( "FamilyBlues", family_blues, 14 )
- T1_FIELD_NUM_TABLE( "FamilyOtherBlues", family_other_blues, 10 )
+ CID_FIELD_NUM_TABLE( "BlueValues", blue_values, 14 )
+ CID_FIELD_NUM_TABLE( "OtherBlues", other_blues, 10 )
+ CID_FIELD_NUM_TABLE( "FamilyBlues", family_blues, 14 )
+ CID_FIELD_NUM_TABLE( "FamilyOtherBlues", family_other_blues, 10 )
- T1_FIELD_NUM_TABLE2( "StdHW", standard_width, 1 )
- T1_FIELD_NUM_TABLE2( "StdVW", standard_height, 1 )
- T1_FIELD_NUM_TABLE2( "MinFeature", min_feature, 2 )
+ CID_FIELD_NUM_TABLE2( "StdHW", standard_width, 1 )
+ CID_FIELD_NUM_TABLE2( "StdVW", standard_height, 1 )
+ CID_FIELD_NUM_TABLE2( "MinFeature", min_feature, 2 )
- T1_FIELD_NUM_TABLE ( "StemSnapH", snap_widths, 12 )
- T1_FIELD_NUM_TABLE ( "StemSnapV", snap_heights, 12 )
+ CID_FIELD_NUM_TABLE ( "StemSnapH", snap_widths, 12 )
+ CID_FIELD_NUM_TABLE ( "StemSnapV", snap_heights, 12 )
/* END */