diff --git a/src/type1z/rules.mk b/src/type1z/rules.mk index d470a8b4a..3eb998698 100644 --- a/src/type1z/rules.mk +++ b/src/type1z/rules.mk @@ -31,17 +31,17 @@ T1Z_COMPILE := $(FT_COMPILE) $(T1Z_CFLAGS) # Type1 driver sources (i.e., C files) # -T1Z_DRV_SRC := $(T1Z_DIR_)t1parse.c \ - $(T1Z_DIR_)t1load.c \ - $(T1Z_DIR_)t1driver.c \ - $(T1Z_DIR_)t1afm.c \ - $(T1Z_DIR_)t1gload.c \ - $(T1Z_DIR_)t1objs.c +T1Z_DRV_SRC := $(T1Z_DIR_)z1parse.c \ + $(T1Z_DIR_)z1load.c \ + $(T1Z_DIR_)z1driver.c \ + $(T1Z_DIR_)z1afm.c \ + $(T1Z_DIR_)z1gload.c \ + $(T1Z_DIR_)z1objs.c # Type1 driver headers # T1Z_DRV_H := $(T1Z_DRV_SRC:%.c=%.h) \ - $(T1Z_DIR_)t1tokens.h + $(T1Z_DIR_)z1tokens.h # Type1z driver object(s) diff --git a/src/type1z/type1z.c b/src/type1z/type1z.c index e85b7870a..a681808b7 100644 --- a/src/type1z/type1z.c +++ b/src/type1z/type1z.c @@ -29,13 +29,13 @@ #define FT_MAKE_OPTION_SINGLE_OBJECT -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include -#ifndef T1_CONFIG_OPTION_NO_AFM -#include +#ifndef Z1_CONFIG_OPTION_NO_AFM +#include #endif diff --git a/src/type1z/t1afm.c b/src/type1z/z1afm.c similarity index 91% rename from src/type1z/t1afm.c rename to src/type1z/z1afm.c index b630f88f0..4651c2109 100644 --- a/src/type1z/t1afm.c +++ b/src/type1z/z1afm.c @@ -5,13 +5,13 @@ * ***************************************************************************/ -#include +#include #include #include #include /* for qsort */ LOCAL_FUNC - void T1_Done_AFM( FT_Memory memory, T1_AFM* afm ) + void Z1_Done_AFM( FT_Memory memory, Z1_AFM* afm ) { FREE( afm->kern_pairs ); afm->num_pairs = 0; @@ -102,8 +102,8 @@ static 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; + Z1_Kern_Pair* pair1 = (Z1_Kern_Pair*)a; + Z1_Kern_Pair* pair2 = (Z1_Kern_Pair*)b; FT_ULong index1 = KERN_INDEX(pair1->glyph1,pair1->glyph2); FT_ULong index2 = KERN_INDEX(pair2->glyph1,pair2->glyph2); @@ -115,7 +115,7 @@ /* parse an AFM file - for now, only read the kerning pairs */ LOCAL_FUNC - FT_Error T1_Read_AFM( FT_Face t1_face, + FT_Error Z1_Read_AFM( FT_Face t1_face, FT_Stream stream ) { FT_Error error; @@ -124,9 +124,9 @@ FT_Byte* limit; FT_Byte* p; FT_Int count = 0; - T1_Kern_Pair* pair; + Z1_Kern_Pair* pair; T1_Font* type1 = &((T1_Face)t1_face)->type1; - T1_AFM* afm = 0; + Z1_AFM* afm = 0; if ( ACCESS_Frame(stream->size) ) return error; @@ -150,7 +150,7 @@ /* allocate the pairs */ if ( ALLOC( afm, sizeof(*afm ) ) || - ALLOC_ARRAY( afm->kern_pairs, count, T1_Kern_Pair ) ) + ALLOC_ARRAY( afm->kern_pairs, count, Z1_Kern_Pair ) ) goto Exit; /* now, read each kern pair */ @@ -183,7 +183,7 @@ } /* now, sort the kern pairs according to their glyph indices */ - qsort( afm->kern_pairs, count, sizeof(T1_Kern_Pair), compare_kern_pairs ); + qsort( afm->kern_pairs, count, sizeof(Z1_Kern_Pair), compare_kern_pairs ); Exit: if (error) @@ -196,12 +196,12 @@ /* find the kerning for a given glyph pair */ LOCAL_FUNC - void T1_Get_Kerning( T1_AFM* afm, + void Z1_Get_Kerning( Z1_AFM* afm, FT_UInt glyph1, FT_UInt glyph2, FT_Vector* kerning ) { - T1_Kern_Pair *min, *mid, *max; + Z1_Kern_Pair *min, *mid, *max; FT_ULong index = KERN_INDEX(glyph1,glyph2); /* simple binary search */ diff --git a/src/type1z/t1afm.h b/src/type1z/z1afm.h similarity index 76% rename from src/type1z/t1afm.h rename to src/type1z/z1afm.h index 3cfbfff32..eb48e1268 100644 --- a/src/type1z/t1afm.h +++ b/src/type1z/z1afm.h @@ -16,33 +16,33 @@ /* In this version, we only read the kerning table from the */ /* AFM file. We may add support for ligatures a bit later.. */ -typedef struct T1_Kern_Pair_ +typedef struct Z1_Kern_Pair_ { FT_UInt glyph1; FT_UInt glyph2; FT_Vector kerning; -} T1_Kern_Pair; +} Z1_Kern_Pair; -typedef struct T1_AFM_ +typedef struct Z1_AFM_ { FT_Int num_pairs; - T1_Kern_Pair* kern_pairs; + Z1_Kern_Pair* kern_pairs; -} T1_AFM; +} Z1_AFM; LOCAL_DEF -FT_Error T1_Read_AFM( FT_Face face, +FT_Error Z1_Read_AFM( FT_Face face, FT_Stream stream ); LOCAL_DEF -void T1_Done_AFM( FT_Memory memory, - T1_AFM* afm ); +void Z1_Done_AFM( FT_Memory memory, + Z1_AFM* afm ); LOCAL_DEF -void T1_Get_Kerning( T1_AFM* afm, +void Z1_Get_Kerning( Z1_AFM* afm, FT_UInt glyph1, FT_UInt glyph2, FT_Vector* kerning ); diff --git a/src/type1z/t1driver.c b/src/type1z/z1driver.c similarity index 93% rename from src/type1z/t1driver.c rename to src/type1z/z1driver.c index 3601a0c2e..a262f275e 100644 --- a/src/type1z/t1driver.c +++ b/src/type1z/z1driver.c @@ -15,10 +15,10 @@ * ******************************************************************/ -#include -#include -#include -#include +#include +#include +#include +#include #include #include @@ -61,21 +61,21 @@ UNUSED(driver); UNUSED(interface); -#ifndef T1_CONFIG_OPTION_NO_MM_SUPPORT +#ifndef Z1_CONFIG_OPTION_NO_MM_SUPPORT if ( strcmp( (const char*)interface, "get_mm" ) == 0 ) - return (FT_Module_Interface)T1_Get_Multi_Master; + return (FT_Module_Interface)Z1_Get_Multi_Master; if ( strcmp( (const char*)interface, "set_mm_design") == 0 ) - return (FT_Module_Interface)T1_Set_MM_Design; + return (FT_Module_Interface)Z1_Set_MM_Design; if ( strcmp( (const char*)interface, "set_mm_blend") == 0 ) - return (FT_Module_Interface)T1_Set_MM_Blend; + return (FT_Module_Interface)Z1_Set_MM_Blend; #endif return 0; } -#ifndef T1_CONFIG_OPTION_NO_AFM +#ifndef Z1_CONFIG_OPTION_NO_AFM /*************************************************************************/ /* */ /* */ @@ -114,14 +114,14 @@ FT_UInt right_glyph, FT_Vector* kerning ) { - T1_AFM* afm; + Z1_AFM* afm; kerning->x = 0; kerning->y = 0; - afm = (T1_AFM*)face->afm_data; + afm = (Z1_AFM*)face->afm_data; if (afm) - T1_Get_Kerning( afm, left_glyph, right_glyph, kerning ); + Z1_Get_Kerning( afm, left_glyph, right_glyph, kerning ); return T1_Err_Ok; } @@ -235,17 +235,17 @@ 0, /* format interface */ - (FT_Module_Constructor) T1_Init_Driver, - (FT_Module_Destructor) T1_Done_Driver, + (FT_Module_Constructor) Z1_Init_Driver, + (FT_Module_Destructor) Z1_Done_Driver, (FT_Module_Requester) Get_Interface, }, sizeof( T1_FaceRec ), - sizeof( T1_SizeRec ), - sizeof( T1_GlyphSlotRec ), + sizeof( Z1_SizeRec ), + sizeof( Z1_GlyphSlotRec ), - (FTDriver_initFace) T1_Init_Face, - (FTDriver_doneFace) T1_Done_Face, + (FTDriver_initFace) Z1_Init_Face, + (FTDriver_doneFace) Z1_Done_Face, (FTDriver_initSize) 0, (FTDriver_doneSize) 0, (FTDriver_initGlyphSlot) 0, @@ -253,15 +253,15 @@ (FTDriver_setCharSizes) 0, (FTDriver_setPixelSizes) 0, - (FTDriver_loadGlyph) T1_Load_Glyph, + (FTDriver_loadGlyph) Z1_Load_Glyph, (FTDriver_getCharIndex) Get_Char_Index, -#ifdef T1_CONFIG_OPTION_NO_AFM +#ifdef Z1_CONFIG_OPTION_NO_AFM (FTDriver_getKerning) 0, (FTDriver_attachFile) 0, #else (FTDriver_getKerning) Get_Kerning, - (FTDriver_attachFile) T1_Read_AFM, + (FTDriver_attachFile) Z1_Read_AFM, #endif (FTDriver_getAdvances) 0 diff --git a/src/type1z/t1driver.h b/src/type1z/z1driver.h similarity index 100% rename from src/type1z/t1driver.h rename to src/type1z/z1driver.h diff --git a/src/type1z/t1gload.c b/src/type1z/z1gload.c similarity index 96% rename from src/type1z/t1gload.c rename to src/type1z/z1gload.c index 30c0e55af..6868339b9 100644 --- a/src/type1z/t1gload.c +++ b/src/type1z/z1gload.c @@ -15,14 +15,14 @@ * ******************************************************************/ -#include +#include #include #include #undef FT_COMPONENT #define FT_COMPONENT trace_t1gload - typedef enum T1_Operator_ + typedef enum Z1_Operator_ { op_none = 0, op_endchar, @@ -53,7 +53,7 @@ op_max /* never remove this one */ - } T1_Operator; + } Z1_Operator; static const FT_Int t1_args_count[ op_max ] = { @@ -101,7 +101,7 @@ /********************************************************************* * * - * T1_Init_Builder + * Z1_Init_Builder * * * Initialise a given glyph builder. @@ -115,10 +115,10 @@ *********************************************************************/ LOCAL_FUNC - void T1_Init_Builder( T1_Builder* builder, + void Z1_Init_Builder( Z1_Builder* builder, T1_Face face, - T1_Size size, - T1_GlyphSlot glyph ) + Z1_Size size, + Z1_GlyphSlot glyph ) { builder->path_begun = 0; builder->load_points = 1; @@ -157,7 +157,7 @@ /********************************************************************* * * - * T1_Done_Builder + * Z1_Done_Builder * * * Finalise a given glyph builder. Its content can still be @@ -170,9 +170,9 @@ *********************************************************************/ LOCAL_FUNC - void T1_Done_Builder( T1_Builder* builder ) + void Z1_Done_Builder( Z1_Builder* builder ) { - T1_GlyphSlot glyph = builder->glyph; + Z1_GlyphSlot glyph = builder->glyph; if (glyph) glyph->root.outline = *builder->base; @@ -183,7 +183,7 @@ /********************************************************************* * * - * T1_Init_Decoder + * Z1_Init_Decoder * * * Initialise a given Type 1 decoder for parsing @@ -195,7 +195,7 @@ *********************************************************************/ LOCAL_FUNC - void T1_Init_Decoder( T1_Decoder* decoder ) + void Z1_Init_Decoder( Z1_Decoder* decoder ) { decoder->top = 0; decoder->zone = 0; @@ -210,7 +210,7 @@ /* check that there is enough room for "count" more points */ static - FT_Error check_points( T1_Builder* builder, + FT_Error check_points( Z1_Builder* builder, FT_Int count ) { return FT_GlyphLoader_Check_Points( builder->loader, count, 0 ); @@ -219,7 +219,7 @@ /* add a new point, do not check room */ static - void add_point( T1_Builder* builder, + void add_point( Z1_Builder* builder, FT_Pos x, FT_Pos y, FT_Byte flag ) @@ -244,7 +244,7 @@ /* check room for a new on-curve point, then add it */ static - FT_Error add_point1( T1_Builder* builder, + FT_Error add_point1( Z1_Builder* builder, FT_Pos x, FT_Pos y ) { @@ -260,7 +260,7 @@ /* check room for a new contour, then add it */ static - FT_Error add_contour( T1_Builder* builder ) + FT_Error add_contour( Z1_Builder* builder ) { FT_Outline* outline = builder->current; FT_Error error; @@ -285,7 +285,7 @@ /* if a path was begun, add its first on-curve point */ static - FT_Error start_point( T1_Builder* builder, + FT_Error start_point( Z1_Builder* builder, FT_Pos x, FT_Pos y ) { @@ -304,7 +304,7 @@ /* close the current contour */ static - void close_contour( T1_Builder* builder ) + void close_contour( Z1_Builder* builder ) { FT_Outline* outline = builder->current; @@ -382,7 +382,7 @@ *********************************************************************/ static - FT_Error t1operator_seac( T1_Decoder* decoder, + FT_Error t1operator_seac( Z1_Decoder* decoder, FT_Pos asb, FT_Pos adx, FT_Pos ady, @@ -447,7 +447,7 @@ FT_GlyphLoader_Prepare( decoder->builder.loader ); /* prepare loader */ - error = T1_Parse_CharStrings( decoder, + error = Z1_Parse_CharStrings( decoder, type1->charstrings [bchar_index], type1->charstrings_len[bchar_index], type1->num_subrs, @@ -469,7 +469,7 @@ /* Now load `achar' on top of */ /* the base outline */ - error = T1_Parse_CharStrings( decoder, + error = Z1_Parse_CharStrings( decoder, type1->charstrings [achar_index], type1->charstrings_len[achar_index], type1->num_subrs, @@ -501,7 +501,7 @@ /********************************************************************* * * - * T1_Parse_CharStrings + * Z1_Parse_CharStrings * * * Parses a given Type 1 charstrings program @@ -522,7 +522,7 @@ #define USE_ARGS(n) top -= n; if (top < decoder->stack) goto Stack_Underflow LOCAL_FUNC - FT_Error T1_Parse_CharStrings( T1_Decoder* decoder, + FT_Error Z1_Parse_CharStrings( Z1_Decoder* decoder, FT_Byte* charstring_base, FT_Int charstring_len, FT_Int num_subrs, @@ -530,10 +530,10 @@ FT_Int* subrs_len ) { FT_Error error; - T1_Decoder_Zone* zone; + Z1_Decoder_Zone* zone; FT_Byte* ip; FT_Byte* limit; - T1_Builder* builder = &decoder->builder; + Z1_Builder* builder = &decoder->builder; FT_Outline* outline; FT_Pos x, y; @@ -558,7 +558,7 @@ while ( ip < limit ) { FT_Int* top = decoder->top; - T1_Operator op = op_none; + Z1_Operator op = op_none; FT_Long value = 0; /********************************************************************/ @@ -791,7 +791,7 @@ } num_points = top[1] - 13 + (top[1] == 18); - if (top[0] != num_points*blend->num_designs) + if (top[0] != (FT_Int)(num_points*blend->num_designs)) { FT_ERROR(( "T1.Parse_CharStrings: incorrect number of mm arguments\n" )); goto Syntax_Error; @@ -1192,19 +1192,19 @@ /**********************************************************************/ LOCAL_FUNC - FT_Error T1_Compute_Max_Advance( T1_Face face, + FT_Error Z1_Compute_Max_Advance( T1_Face face, FT_Int *max_advance ) { FT_Error error; - T1_Decoder decoder; + Z1_Decoder decoder; FT_Int glyph_index; T1_Font* type1 = &face->type1; *max_advance = 0; /* Initialise load decoder */ - T1_Init_Decoder( &decoder ); - T1_Init_Builder( &decoder.builder, face, 0, 0 ); + Z1_Init_Decoder( &decoder ); + Z1_Init_Builder( &decoder.builder, face, 0, 0 ); decoder.blend = face->blend; decoder.builder.metrics_only = 1; @@ -1215,7 +1215,7 @@ for ( glyph_index = 0; glyph_index < type1->num_glyphs; glyph_index++ ) { /* now get load the unscaled outline */ - error = T1_Parse_CharStrings( &decoder, + error = Z1_Parse_CharStrings( &decoder, type1->charstrings [glyph_index], type1->charstrings_len[glyph_index], type1->num_subrs, @@ -1246,13 +1246,13 @@ LOCAL_FUNC - FT_Error T1_Load_Glyph( T1_GlyphSlot glyph, - T1_Size size, + FT_Error Z1_Load_Glyph( Z1_GlyphSlot glyph, + Z1_Size size, FT_Int glyph_index, FT_Int load_flags ) { FT_Error error; - T1_Decoder decoder; + Z1_Decoder decoder; T1_Face face = (T1_Face)glyph->root.face; FT_Bool hinting; T1_Font* type1 = &face->type1; @@ -1269,17 +1269,17 @@ hinting = ( load_flags & FT_LOAD_NO_SCALE ) == 0 && ( load_flags & FT_LOAD_NO_HINTING ) == 0; - glyph->root.format = ft_glyph_format_none; + glyph->root.format = ft_glyph_format_outline; { - T1_Init_Decoder( &decoder ); - T1_Init_Builder( &decoder.builder, face, size, glyph ); + Z1_Init_Decoder( &decoder ); + Z1_Init_Builder( &decoder.builder, face, size, glyph ); decoder.blend = ((T1_Face)glyph->root.face)->blend; decoder.builder.no_recurse = (FT_Bool)!!(load_flags & FT_LOAD_NO_RECURSE); /* now load the unscaled outline */ - error = T1_Parse_CharStrings( &decoder, + error = Z1_Parse_CharStrings( &decoder, type1->charstrings [glyph_index], type1->charstrings_len[glyph_index], type1->num_subrs, @@ -1287,7 +1287,7 @@ type1->subrs_len ); /* save new glyph tables */ - T1_Done_Builder( &decoder.builder ); + Z1_Done_Builder( &decoder.builder ); } /* Now, set the metrics.. - this is rather simple, as : */ diff --git a/src/type1z/t1gload.h b/src/type1z/z1gload.h similarity index 85% rename from src/type1z/t1gload.h rename to src/type1z/z1gload.h index 2bfa1b8fa..4140792da 100644 --- a/src/type1z/t1gload.h +++ b/src/type1z/z1gload.h @@ -17,12 +17,12 @@ * The Type 1 glyph loader uses three distinct objects to build * scaled and hinted outlines from a charstrings program. These are : * - * - a glyph builder, T1_Builder, used to store the built outline + * - a glyph builder, Z1_Builder, used to store the built outline * - * - a glyph hinter, T1_Hinter, used to record and apply the stem + * - a glyph hinter, Z1_Hinter, used to record and apply the stem * hints * - * - a charstrings interpreter, T1_Decoder, used to parse the + * - a charstrings interpreter, Z1_Decoder, used to parse the * Type 1 charstrings stream, manage a stack and call the builder * and/or hinter depending on the opcodes. * @@ -35,7 +35,7 @@ #ifndef T1GLOAD_H #define T1GLOAD_H -#include +#include #ifdef __cplusplus extern "C" { @@ -44,7 +44,7 @@ /*************************************************************************/ /* */ -/* T1_Builder */ +/* Z1_Builder */ /* */ /* */ /* a structure used during glyph loading to store its outline. */ @@ -81,11 +81,11 @@ /* all of its points.. */ /* */ - typedef struct T1_Builder_ + typedef struct Z1_Builder_ { FT_Memory memory; T1_Face face; - T1_GlyphSlot glyph; + Z1_GlyphSlot glyph; FT_GlyphLoader* loader; FT_Outline* current; /* the current glyph outline */ @@ -110,28 +110,28 @@ FT_Error error; /* only used for memory errors */ FT_Bool metrics_only; - } T1_Builder; + } Z1_Builder; /* execution context charstring zone */ - typedef struct T1_Decoder_Zone_ + typedef struct Z1_Decoder_Zone_ { FT_Byte* base; FT_Byte* limit; FT_Byte* cursor; - } T1_Decoder_Zone; + } Z1_Decoder_Zone; - typedef struct T1_Decoder_ + typedef struct Z1_Decoder_ { - T1_Builder builder; + Z1_Builder builder; FT_Int stack[ T1_MAX_CHARSTRINGS_OPERANDS ]; FT_Int* top; - T1_Decoder_Zone zones[ T1_MAX_SUBRS_CALLS+1 ]; - T1_Decoder_Zone* zone; + Z1_Decoder_Zone zones[ T1_MAX_SUBRS_CALLS+1 ]; + Z1_Decoder_Zone* zone; FT_Int flex_state; FT_Int num_flex_vectors; @@ -139,33 +139,33 @@ T1_Blend* blend; /* for multiple masters */ - } T1_Decoder; + } Z1_Decoder; LOCAL_DEF - void T1_Init_Builder( T1_Builder* builder, + void Z1_Init_Builder( Z1_Builder* builder, T1_Face face, - T1_Size size, - T1_GlyphSlot glyph ); + Z1_Size size, + Z1_GlyphSlot glyph ); LOCAL_DEF - void T1_Done_Builder( T1_Builder* builder ); + void Z1_Done_Builder( Z1_Builder* builder ); LOCAL_DEF - void T1_Init_Decoder( T1_Decoder* decoder ); + void Z1_Init_Decoder( Z1_Decoder* decoder ); /* Compute the maximum advance width of a font through quick parsing */ LOCAL_DEF - FT_Error T1_Compute_Max_Advance( T1_Face face, + FT_Error Z1_Compute_Max_Advance( T1_Face face, FT_Int *max_advance ); /* This function is exported, because it is used by the T1Dump utility */ LOCAL_DEF - FT_Error T1_Parse_CharStrings( T1_Decoder* decoder, + FT_Error Z1_Parse_CharStrings( Z1_Decoder* decoder, FT_Byte* charstring_base, FT_Int charstring_len, FT_Int num_subrs, @@ -175,8 +175,8 @@ LOCAL_DEF - FT_Error T1_Load_Glyph( T1_GlyphSlot glyph, - T1_Size size, + FT_Error Z1_Load_Glyph( Z1_GlyphSlot glyph, + Z1_Size size, FT_Int glyph_index, FT_Int load_flags ); diff --git a/src/type1z/t1load.c b/src/type1z/z1load.c similarity index 80% rename from src/type1z/t1load.c rename to src/type1z/z1load.c index 0029e4dea..3083b5f0e 100644 --- a/src/type1z/t1load.c +++ b/src/type1z/z1load.c @@ -65,13 +65,13 @@ #include #include -#include +#include #include #undef FT_COMPONENT #define FT_COMPONENT trace_t1load -#ifndef T1_CONFIG_OPTION_NO_MM_SUPPORT +#ifndef Z1_CONFIG_OPTION_NO_MM_SUPPORT /***************************************************************************/ /***************************************************************************/ /***** *****/ @@ -148,7 +148,7 @@ goto Exit; } - LOCAL_FUNC FT_Error T1_Get_Multi_Master( T1_Face face, + LOCAL_FUNC FT_Error Z1_Get_Multi_Master( T1_Face face, FT_Multi_Master* master ) { T1_Blend* blend = face->blend; @@ -175,7 +175,7 @@ } - LOCAL_FUNC FT_Error T1_Set_MM_Blend( T1_Face face, + LOCAL_FUNC FT_Error Z1_Set_MM_Blend( T1_Face face, FT_UInt num_coords, FT_Fixed* coords ) { @@ -213,7 +213,7 @@ } - LOCAL_FUNC FT_Error T1_Set_MM_Design( T1_Face face, + LOCAL_FUNC FT_Error Z1_Set_MM_Design( T1_Face face, FT_UInt num_coords, FT_Long* coords ) { @@ -271,13 +271,13 @@ final_blends[n] = the_blend; } - error = T1_Set_MM_Blend( face, num_coords, final_blends ); + error = Z1_Set_MM_Blend( face, num_coords, final_blends ); } return error; } - LOCAL_FUNC void T1_Done_Blend( T1_Face face ) + LOCAL_FUNC void Z1_Done_Blend( T1_Face face ) { FT_Memory memory = face->root.memory; T1_Blend* blend = face->blend; @@ -324,16 +324,16 @@ - static void parse_blend_axis_types( T1_Face face, T1_Loader* loader ) + static void parse_blend_axis_types( T1_Face face, Z1_Loader* loader ) { - T1_Token_Rec axis_tokens[ T1_MAX_MM_AXIS ]; + Z1_Token_Rec axis_tokens[ T1_MAX_MM_AXIS ]; FT_Int n, num_axis; FT_Error error = 0; T1_Blend* blend; FT_Memory memory; /* take an array of objects */ - T1_ToTokenArray( &loader->parser, axis_tokens, T1_MAX_MM_AXIS, &num_axis ); + Z1_ToTokenArray( &loader->parser, axis_tokens, T1_MAX_MM_AXIS, &num_axis ); if (num_axis <= 0 || num_axis > T1_MAX_MM_AXIS) { FT_ERROR(( "T1.parse_blend_axis_types: incorrect number of axis: %d\n", @@ -352,7 +352,7 @@ /* each token is an immediate containing the name of the axis */ for ( n = 0; n < num_axis; n++ ) { - T1_Token_Rec* token = axis_tokens + n; + Z1_Token_Rec* token = axis_tokens + n; FT_Byte* name; FT_Int len; @@ -380,18 +380,18 @@ } - static void parse_blend_design_positions( T1_Face face, T1_Loader* loader ) + static void parse_blend_design_positions( T1_Face face, Z1_Loader* loader ) { - T1_Token_Rec design_tokens[ T1_MAX_MM_DESIGNS ]; + Z1_Token_Rec design_tokens[ T1_MAX_MM_DESIGNS ]; FT_Int num_designs; FT_Int num_axis; - T1_Parser* parser = &loader->parser; + Z1_Parser* parser = &loader->parser; FT_Error error = 0; T1_Blend* blend; /* get the array of design tokens - compute number of designs */ - T1_ToTokenArray( parser, design_tokens, T1_MAX_MM_DESIGNS, &num_designs ); + Z1_ToTokenArray( parser, design_tokens, T1_MAX_MM_DESIGNS, &num_designs ); if (num_designs <= 0 || num_designs > T1_MAX_MM_DESIGNS) { FT_ERROR(( "T1.design positions: incorrect number of designs: %d\n", @@ -409,15 +409,15 @@ num_axis = 0; /* make compiler happy */ for ( n = 0; n < (FT_UInt)num_designs; n++ ) { - T1_Token_Rec axis_tokens[ T1_MAX_MM_DESIGNS ]; - T1_Token_Rec* token; + Z1_Token_Rec axis_tokens[ T1_MAX_MM_DESIGNS ]; + Z1_Token_Rec* token; FT_Int axis, n_axis; /* read axis/coordinates tokens */ token = design_tokens + n; parser->cursor = token->start - 1; parser->limit = token->limit + 1; - T1_ToTokenArray( parser, axis_tokens, T1_MAX_MM_AXIS, &n_axis ); + Z1_ToTokenArray( parser, axis_tokens, T1_MAX_MM_AXIS, &n_axis ); if (n == 0) { @@ -436,10 +436,10 @@ /* now, read each axis token into the design position */ for (axis = 0; axis < n_axis; axis++ ) { - T1_Token_Rec* token2 = axis_tokens + axis; + Z1_Token_Rec* token2 = axis_tokens + axis; parser->cursor = token2->start; parser->limit = token2->limit; - blend->design_pos[n][axis] = T1_ToFixed( parser, 0 ); + blend->design_pos[n][axis] = Z1_ToFixed( parser, 0 ); } } @@ -451,18 +451,18 @@ loader->parser.error = error; } - static void parse_blend_design_map( T1_Face face, T1_Loader* loader ) + static void parse_blend_design_map( T1_Face face, Z1_Loader* loader ) { FT_Error error = 0; - T1_Parser* parser = &loader->parser; + Z1_Parser* parser = &loader->parser; T1_Blend* blend; - T1_Token_Rec axis_tokens[ T1_MAX_MM_AXIS ]; + Z1_Token_Rec axis_tokens[ T1_MAX_MM_AXIS ]; FT_Int n, num_axis; FT_Byte* old_cursor; FT_Byte* old_limit; FT_Memory memory = face->root.memory; - T1_ToTokenArray( parser, axis_tokens, T1_MAX_MM_AXIS, &num_axis ); + Z1_ToTokenArray( parser, axis_tokens, T1_MAX_MM_AXIS, &num_axis ); if (num_axis <= 0 || num_axis > T1_MAX_MM_AXIS) { FT_ERROR(( "T1.design map: incorrect number of axis: %d\n", @@ -481,7 +481,7 @@ for ( n = 0; n < num_axis; n++ ) { T1_DesignMap* map = blend->design_map + n; - T1_Token_Rec* token; + Z1_Token_Rec* token; FT_Int p, num_points; token = axis_tokens + n; @@ -513,8 +513,8 @@ for ( p = 0; p < num_points; p++ ) { - map->design_points[p] = T1_ToInt( parser ); - map->blend_points [p] = T1_ToFixed( parser, 0 ); + map->design_points[p] = Z1_ToInt( parser ); + map->blend_points [p] = Z1_ToFixed( parser, 0 ); } } @@ -524,12 +524,12 @@ parser->error = error; } - static void parse_weight_vector( T1_Face face, T1_Loader* loader ) + static void parse_weight_vector( T1_Face face, Z1_Loader* loader ) { FT_Error error = 0; - T1_Parser* parser = &loader->parser; + Z1_Parser* parser = &loader->parser; T1_Blend* blend = face->blend; - T1_Token_Rec master; + Z1_Token_Rec master; FT_UInt n; FT_Byte* old_cursor; FT_Byte* old_limit; @@ -541,7 +541,7 @@ goto Exit; } - T1_ToToken( parser, &master ); + Z1_ToToken( parser, &master ); if (master.type != t1_token_array) { FT_ERROR(( "t1.weight_vector: incorrect format !!\n" )); @@ -557,7 +557,7 @@ for ( n = 0; n < blend->num_designs; n++ ) { blend->default_weight_vector[n] = - blend->weight_vector[n] = T1_ToFixed( parser, 0 ); + blend->weight_vector[n] = Z1_ToFixed( parser, 0 ); } parser->cursor = old_cursor; @@ -569,9 +569,9 @@ /* the keyword /shareddict appears in some multiple master fonts with a lot */ /* of Postscript garbage behind it (that's completely out of spec !!), we */ /* detect it and terminate the parsing */ - static void parse_shared_dict( T1_Face face, T1_Loader* loader ) + static void parse_shared_dict( T1_Face face, Z1_Loader* loader ) { - T1_Parser* parser = &loader->parser; + Z1_Parser* parser = &loader->parser; UNUSED(face); @@ -591,126 +591,126 @@ /********************************************************************* * * First of all, define the token field static variables. This is - * a set of T1_Field_Rec variables used later.. + * a set of Z1_Field_Rec variables used later.. * *********************************************************************/ -#define T1_NEW_STRING( _name, _field ) \ - static const T1_Field_Rec t1_field_ ## _field = T1_FIELD_STRING( T1TYPE, _field ); +#define Z1_NEW_STRING( _name, _field ) \ + static const Z1_Field_Rec t1_field_ ## _field = Z1_FIELD_STRING( T1TYPE, _field ); -#define T1_NEW_BOOL( _name, _field ) \ - static const T1_Field_Rec t1_field_ ## _field = T1_FIELD_BOOL( T1TYPE, _field ); +#define Z1_NEW_BOOL( _name, _field ) \ + static const Z1_Field_Rec t1_field_ ## _field = Z1_FIELD_BOOL( T1TYPE, _field ); -#define T1_NEW_NUM( _name, _field ) \ - static const T1_Field_Rec t1_field_ ## _field = T1_FIELD_NUM( T1TYPE, _field ); +#define Z1_NEW_NUM( _name, _field ) \ + static const Z1_Field_Rec t1_field_ ## _field = Z1_FIELD_NUM( T1TYPE, _field ); -#define T1_NEW_FIXED( _name, _field ) \ - static const T1_Field_Rec t1_field_ ## _field = T1_FIELD_FIXED( T1TYPE, _field, _power ); +#define Z1_NEW_FIXED( _name, _field ) \ + static const Z1_Field_Rec t1_field_ ## _field = Z1_FIELD_FIXED( T1TYPE, _field, _power ); -#define T1_NEW_NUM_TABLE( _name, _field, _max, _count ) \ - static const T1_Field_Rec t1_field_ ## _field = T1_FIELD_NUM_ARRAY( T1TYPE, _field, _count, _max ); +#define Z1_NEW_NUM_TABLE( _name, _field, _max, _count ) \ + static const Z1_Field_Rec t1_field_ ## _field = Z1_FIELD_NUM_ARRAY( T1TYPE, _field, _count, _max ); -#define T1_NEW_FIXED_TABLE( _name, _field, _max, _count ) \ - static const T1_Field_Rec t1_field_ ## _field = T1_FIELD_FIXED_ARRAY( T1TYPE, _field, _count, _max ); +#define Z1_NEW_FIXED_TABLE( _name, _field, _max, _count ) \ + static const Z1_Field_Rec t1_field_ ## _field = Z1_FIELD_FIXED_ARRAY( T1TYPE, _field, _count, _max ); -#define T1_NEW_NUM_TABLE2( _name, _field, _max ) \ - static const T1_Field_Rec t1_field_ ## _field = T1_FIELD_NUM_ARRAY2( T1TYPE, _field, _max ); +#define Z1_NEW_NUM_TABLE2( _name, _field, _max ) \ + static const Z1_Field_Rec t1_field_ ## _field = Z1_FIELD_NUM_ARRAY2( T1TYPE, _field, _max ); -#define T1_NEW_FIXED_TABLE2( _name, _field, _max ) \ - static const T1_Field_Rec t1_field_ ## _field = T1_FIELD_FIXED_ARRAY2( T1TYPE, _field, _max ); +#define Z1_NEW_FIXED_TABLE2( _name, _field, _max ) \ + static const Z1_Field_Rec t1_field_ ## _field = Z1_FIELD_FIXED_ARRAY2( T1TYPE, _field, _max ); -#define T1_FONTINFO_STRING(n,f) T1_NEW_STRING(n,f) -#define T1_FONTINFO_NUM(n,f) T1_NEW_NUM(n,f) -#define T1_FONTINFO_BOOL(n,f) T1_NEW_BOOL(n,f) -#define T1_PRIVATE_NUM(n,f) T1_NEW_NUM(n,f) -#define T1_PRIVATE_FIXED(n,f) T1_NEW_FIXED(n,f) -#define T1_PRIVATE_NUM_TABLE(n,f,m,c) T1_NEW_NUM_TABLE(n,f,m,c) -#define T1_PRIVATE_NUM_TABLE2(n,f,m) T1_NEW_NUM_TABLE2(n,f,m) -#define T1_TOPDICT_NUM(n,f) T1_NEW_NUM(n,f) -#define T1_TOPDICT_NUM_FIXED2(n,f,m) T1_NEW_FIXED_TABLE2(n,f,m) +#define Z1_FONTINFO_STRING(n,f) Z1_NEW_STRING(n,f) +#define Z1_FONTINFO_NUM(n,f) Z1_NEW_NUM(n,f) +#define Z1_FONTINFO_BOOL(n,f) Z1_NEW_BOOL(n,f) +#define Z1_PRIVATE_NUM(n,f) Z1_NEW_NUM(n,f) +#define Z1_PRIVATE_FIXED(n,f) Z1_NEW_FIXED(n,f) +#define Z1_PRIVATE_NUM_TABLE(n,f,m,c) Z1_NEW_NUM_TABLE(n,f,m,c) +#define Z1_PRIVATE_NUM_TABLE2(n,f,m) Z1_NEW_NUM_TABLE2(n,f,m) +#define Z1_TOPDICT_NUM(n,f) Z1_NEW_NUM(n,f) +#define Z1_TOPDICT_NUM_FIXED2(n,f,m) Z1_NEW_FIXED_TABLE2(n,f,m) /* including this file defines all field variables */ -#include +#include /********************************************************************* * - * Second, define the keyword variables. This is a set of T1_KeyWord + * Second, define the keyword variables. This is a set of Z1_KeyWord * structures used to model the way each keyword is "loaded".. * *********************************************************************/ - typedef void (*T1_Parse_Func)( T1_Face face, T1_Loader* loader ); + typedef void (*Z1_Parse_Func)( T1_Face face, Z1_Loader* loader ); - typedef enum T1_KeyWord_Type_ + typedef enum Z1_KeyWord_Type_ { t1_keyword_callback = 0, t1_keyword_field, t1_keyword_field_table - } T1_KeyWord_Type; + } Z1_KeyWord_Type; - typedef enum T1_KeyWord_Location_ + typedef enum Z1_KeyWord_Location_ { t1_keyword_type1 = 0, t1_keyword_font_info, t1_keyword_private - } T1_KeyWord_Location; + } Z1_KeyWord_Location; - typedef struct T1_KeyWord_ + typedef struct Z1_KeyWord_ { const char* name; - T1_KeyWord_Type type; - T1_KeyWord_Location location; - T1_Parse_Func parsing; - const T1_Field_Rec* field; + Z1_KeyWord_Type type; + Z1_KeyWord_Location location; + Z1_Parse_Func parsing; + const Z1_Field_Rec* field; - } T1_KeyWord; + } Z1_KeyWord; -#define T1_KEYWORD_CALLBACK( name, callback ) \ +#define Z1_KEYWORD_CALLBACK( name, callback ) \ { name, t1_keyword_callback, t1_keyword_type1, callback, 0 } -#define T1_KEYWORD_TYPE1( name, f ) \ +#define Z1_KEYWORD_TYPE1( name, f ) \ { name, t1_keyword_field, t1_keyword_type1, 0, &t1_field_ ## f } -#define T1_KEYWORD_FONTINFO( name, f ) \ +#define Z1_KEYWORD_FONTINFO( name, f ) \ { name, t1_keyword_field, t1_keyword_font_info, 0, &t1_field_ ## f } -#define T1_KEYWORD_PRIVATE( name, f ) \ +#define Z1_KEYWORD_PRIVATE( name, f ) \ { name, t1_keyword_field, t1_keyword_private, 0, &t1_field_ ## f } -#define T1_KEYWORD_FONTINFO_TABLE( name, f ) \ +#define Z1_KEYWORD_FONTINFO_TABLE( name, f ) \ { name, t1_keyword_field_table, t1_keyword_font_info, 0, &t1_field_ ## f } -#define T1_KEYWORD_PRIVATE_TABLE( name, f ) \ +#define Z1_KEYWORD_PRIVATE_TABLE( name, f ) \ { name, t1_keyword_field_table, t1_keyword_private, 0, &t1_field_ ## f } -#undef T1_FONTINFO_STRING -#undef T1_FONTINFO_NUM -#undef T1_FONTINFO_BOOL -#undef T1_PRIVATE_NUM -#undef T1_PRIVATE_FIXED -#undef T1_PRIVATE_NUM_TABLE -#undef T1_PRIVATE_NUM_TABLE2 -#undef T1_TOPDICT_NUM -#undef T1_TOPDICT_NUM_FIXED2 +#undef Z1_FONTINFO_STRING +#undef Z1_FONTINFO_NUM +#undef Z1_FONTINFO_BOOL +#undef Z1_PRIVATE_NUM +#undef Z1_PRIVATE_FIXED +#undef Z1_PRIVATE_NUM_TABLE +#undef Z1_PRIVATE_NUM_TABLE2 +#undef Z1_TOPDICT_NUM +#undef Z1_TOPDICT_NUM_FIXED2 -#define T1_FONTINFO_STRING(n,f) T1_KEYWORD_FONTINFO(n,f), -#define T1_FONTINFO_NUM(n,f) T1_KEYWORD_FONTINFO(n,f), -#define T1_FONTINFO_BOOL(n,f) T1_KEYWORD_FONTINFO(n,f), -#define T1_PRIVATE_NUM(n,f) T1_KEYWORD_PRIVATE(n,f), -#define T1_PRIVATE_FIXED(n,f) T1_KEYWORD_PRIVATE(n,f), -#define T1_PRIVATE_NUM_TABLE(n,f,m,c) T1_KEYWORD_PRIVATE_TABLE(n,f), -#define T1_PRIVATE_NUM_TABLE2(n,f,m) T1_KEYWORD_PRIVATE_TABLE(n,f), -#define T1_TOPDICT_NUM(n,f) T1_KEYWORD_TYPE1(n,f), -#define T1_TOPDICT_NUM_FIXED2(n,f,m) T1_KEYWORD_TYPE1(n,f), +#define Z1_FONTINFO_STRING(n,f) Z1_KEYWORD_FONTINFO(n,f), +#define Z1_FONTINFO_NUM(n,f) Z1_KEYWORD_FONTINFO(n,f), +#define Z1_FONTINFO_BOOL(n,f) Z1_KEYWORD_FONTINFO(n,f), +#define Z1_PRIVATE_NUM(n,f) Z1_KEYWORD_PRIVATE(n,f), +#define Z1_PRIVATE_FIXED(n,f) Z1_KEYWORD_PRIVATE(n,f), +#define Z1_PRIVATE_NUM_TABLE(n,f,m,c) Z1_KEYWORD_PRIVATE_TABLE(n,f), +#define Z1_PRIVATE_NUM_TABLE2(n,f,m) Z1_KEYWORD_PRIVATE_TABLE(n,f), +#define Z1_TOPDICT_NUM(n,f) Z1_KEYWORD_TYPE1(n,f), +#define Z1_TOPDICT_NUM_FIXED2(n,f,m) Z1_KEYWORD_TYPE1(n,f), static FT_Error t1_load_keyword( T1_Face face, - T1_Loader* loader, - T1_KeyWord* keyword ) + Z1_Loader* loader, + Z1_KeyWord* keyword ) { FT_Error error; void* dummy_object; @@ -763,9 +763,9 @@ } if (keyword->type == t1_keyword_field_table) - error = T1_Load_Field_Table( &loader->parser, keyword->field, objects, max_objects, 0 ); + error = Z1_Load_Field_Table( &loader->parser, keyword->field, objects, max_objects, 0 ); else - error = T1_Load_Field( &loader->parser, keyword->field, objects, max_objects, 0 ); + error = Z1_Load_Field( &loader->parser, keyword->field, objects, max_objects, 0 ); Exit: return error; @@ -789,7 +789,7 @@ } static - void skip_whitespace( T1_Parser* parser ) + void skip_whitespace( Z1_Parser* parser ) { FT_Byte* cur = parser->cursor; @@ -800,7 +800,7 @@ } static - void skip_blackspace( T1_Parser* parser ) + void skip_blackspace( Z1_Parser* parser ) { FT_Byte* cur = parser->cursor; @@ -811,7 +811,7 @@ } static - int read_binary_data( T1_Parser* parser, FT_Int *size, FT_Byte* *base ) + int read_binary_data( Z1_Parser* parser, FT_Int *size, FT_Byte* *base ) { FT_Byte* cur; FT_Byte* limit = parser->limit; @@ -826,7 +826,7 @@ if ( cur < limit && (FT_Byte)(*cur-'0') < 10 ) { - *size = T1_ToInt(parser); + *size = Z1_ToInt(parser); skip_whitespace(parser); skip_blackspace(parser); /* "RD" or "-|" or something else */ @@ -850,9 +850,9 @@ /* dictionaries.. */ static - void parse_font_name( T1_Face face, T1_Loader* loader ) + void parse_font_name( T1_Face face, Z1_Loader* loader ) { - T1_Parser* parser = &loader->parser; + Z1_Parser* parser = &loader->parser; FT_Error error; FT_Memory memory = parser->memory; FT_Int len; @@ -884,13 +884,13 @@ } static - void parse_font_bbox( T1_Face face, T1_Loader* loader ) + void parse_font_bbox( T1_Face face, Z1_Loader* loader ) { - T1_Parser* parser = &loader->parser; + Z1_Parser* parser = &loader->parser; FT_Short temp[4]; FT_BBox* bbox = &face->type1.font_bbox; - (void)T1_ToCoordArray( parser, 4, temp ); + (void)Z1_ToCoordArray( parser, 4, temp ); bbox->xMin = temp[0]; bbox->yMin = temp[1]; bbox->xMax = temp[2]; @@ -898,13 +898,13 @@ } static - void parse_font_matrix( T1_Face face, T1_Loader* loader ) + void parse_font_matrix( T1_Face face, Z1_Loader* loader ) { - T1_Parser* parser = &loader->parser; + Z1_Parser* parser = &loader->parser; FT_Matrix* matrix = &face->type1.font_matrix; FT_Fixed temp[4]; - (void)T1_ToFixedArray( parser, 4, temp, 3 ); + (void)Z1_ToFixedArray( parser, 4, temp, 3 ); matrix->xx = temp[0]; matrix->yx = temp[1]; matrix->xy = temp[2]; @@ -914,9 +914,9 @@ static - void parse_encoding( T1_Face face, T1_Loader* loader ) + void parse_encoding( T1_Face face, Z1_Loader* loader ) { - T1_Parser* parser = &loader->parser; + Z1_Parser* parser = &loader->parser; FT_Byte* cur = parser->cursor; FT_Byte* limit = parser->limit; @@ -938,19 +938,19 @@ { T1_Encoding* encode = &face->type1.encoding; FT_Int count, n; - T1_Table* char_table = &loader->encoding_table; + Z1_Table* char_table = &loader->encoding_table; FT_Memory memory = parser->memory; FT_Error error; /* read the number of entries in the encoding, should be 256 */ - count = T1_ToInt( parser ); + count = Z1_ToInt( parser ); if (parser->error) return; - /* we use a T1_Table to store our charnames */ + /* we use a Z1_Table to store our charnames */ encode->num_chars = count; if ( ALLOC_ARRAY( encode->char_index, count, FT_Short ) || ALLOC_ARRAY( encode->char_name, count, FT_String* ) || - (error = T1_New_Table( char_table, count, memory )) != 0 ) + (error = Z1_New_Table( char_table, count, memory )) != 0 ) { parser->error = error; return; @@ -999,7 +999,7 @@ FT_Int charcode; parser->cursor = cur; - charcode = T1_ToInt(parser); + charcode = Z1_ToInt(parser); cur = parser->cursor; /* skip whitespace */ @@ -1014,7 +1014,7 @@ while (cur2 < limit && is_alpha(*cur2)) cur2++; len = cur2-cur-1; - parser->error = T1_Add_Table( char_table, charcode, cur+1, len+1 ); + parser->error = Z1_Add_Table( char_table, charcode, cur+1, len+1 ); char_table->elements[charcode][len] = '\0'; if (parser->error) return; @@ -1050,19 +1050,19 @@ static - void parse_subrs( T1_Face face, T1_Loader* loader ) + void parse_subrs( T1_Face face, Z1_Loader* loader ) { - T1_Parser* parser = &loader->parser; - T1_Table* table = &loader->subrs; + Z1_Parser* parser = &loader->parser; + Z1_Table* table = &loader->subrs; FT_Memory memory = parser->memory; FT_Error error; FT_Int n; - loader->num_subrs = T1_ToInt( parser ); + loader->num_subrs = Z1_ToInt( parser ); if (parser->error) return; /* initialise subrs array */ - error = T1_New_Table( table, loader->num_subrs, memory ); + error = Z1_New_Table( table, loader->num_subrs, memory ); if (error) goto Fail; /* the format is simple : */ @@ -1075,7 +1075,7 @@ FT_Int index, size; FT_Byte* base; - index = T1_ToInt(parser); + index = Z1_ToInt(parser); if (!read_binary_data(parser,&size,&base)) return; /* some fonts use a value of -1 for lenIV to indicate that */ @@ -1085,12 +1085,12 @@ /* */ if (face->type1.private_dict.lenIV >= 0) { - T1_Decrypt( base, size, 4330 ); + Z1_Decrypt( base, size, 4330 ); size -= face->type1.private_dict.lenIV; base += face->type1.private_dict.lenIV; } - error = T1_Add_Table( table, index, base, size ); + error = Z1_Add_Table( table, index, base, size ); if (error) goto Fail; } return; @@ -1103,11 +1103,11 @@ static - void parse_charstrings( T1_Face face, T1_Loader* loader ) + void parse_charstrings( T1_Face face, Z1_Loader* loader ) { - T1_Parser* parser = &loader->parser; - T1_Table* code_table = &loader->charstrings; - T1_Table* name_table = &loader->glyph_names; + Z1_Parser* parser = &loader->parser; + Z1_Table* code_table = &loader->charstrings; + Z1_Table* name_table = &loader->glyph_names; FT_Memory memory = parser->memory; FT_Error error; @@ -1115,12 +1115,12 @@ FT_Byte* limit = parser->limit; FT_Int n; - loader->num_glyphs = T1_ToInt( parser ); + loader->num_glyphs = Z1_ToInt( parser ); if (parser->error) return; /* initialise tables */ - error = T1_New_Table( code_table, loader->num_glyphs, memory ) || - T1_New_Table( name_table, loader->num_glyphs, memory ); + error = Z1_New_Table( code_table, loader->num_glyphs, memory ) || + Z1_New_Table( name_table, loader->num_glyphs, memory ); if (error) goto Fail; n = 0; @@ -1161,7 +1161,7 @@ while (cur2 < limit && is_alpha(*cur2)) cur2++; len = cur2-cur-1; - error = T1_Add_Table( name_table, n, cur+1, len+1 ); + error = Z1_Add_Table( name_table, n, cur+1, len+1 ); if (error) goto Fail; /* add a trailing zero to the name table */ @@ -1177,12 +1177,12 @@ /* */ if (face->type1.private_dict.lenIV >= 0) { - T1_Decrypt( base, size, 4330 ); + Z1_Decrypt( base, size, 4330 ); size -= face->type1.private_dict.lenIV; base += face->type1.private_dict.lenIV; } - error = T1_Add_Table( code_table, n, base, size ); + error = Z1_Add_Table( code_table, n, base, size ); if (error) goto Fail; n++; @@ -1201,35 +1201,35 @@ static - const T1_KeyWord t1_keywords[] = + const Z1_KeyWord t1_keywords[] = { -#include +#include /* now add the special functions... */ - T1_KEYWORD_CALLBACK( "FontName", parse_font_name ), - T1_KEYWORD_CALLBACK( "FontBBox", parse_font_bbox ), - T1_KEYWORD_CALLBACK( "FontMatrix", parse_font_matrix ), - T1_KEYWORD_CALLBACK( "Encoding", parse_encoding ), - T1_KEYWORD_CALLBACK( "Subrs", parse_subrs ), - T1_KEYWORD_CALLBACK( "CharStrings", parse_charstrings ), -#ifndef T1_CONFIG_OPTION_NO_MM_SUPPORT - T1_KEYWORD_CALLBACK( "BlendDesignPositions", parse_blend_design_positions ), - T1_KEYWORD_CALLBACK( "BlendDesignMap", parse_blend_design_map ), - T1_KEYWORD_CALLBACK( "BlendAxisTypes", parse_blend_axis_types ), - T1_KEYWORD_CALLBACK( "WeightVector", parse_weight_vector ), - T1_KEYWORD_CALLBACK( "shareddict", parse_shared_dict ), + Z1_KEYWORD_CALLBACK( "FontName", parse_font_name ), + Z1_KEYWORD_CALLBACK( "FontBBox", parse_font_bbox ), + Z1_KEYWORD_CALLBACK( "FontMatrix", parse_font_matrix ), + Z1_KEYWORD_CALLBACK( "Encoding", parse_encoding ), + Z1_KEYWORD_CALLBACK( "Subrs", parse_subrs ), + Z1_KEYWORD_CALLBACK( "CharStrings", parse_charstrings ), +#ifndef Z1_CONFIG_OPTION_NO_MM_SUPPORT + Z1_KEYWORD_CALLBACK( "BlendDesignPositions", parse_blend_design_positions ), + Z1_KEYWORD_CALLBACK( "BlendDesignMap", parse_blend_design_map ), + Z1_KEYWORD_CALLBACK( "BlendAxisTypes", parse_blend_axis_types ), + Z1_KEYWORD_CALLBACK( "WeightVector", parse_weight_vector ), + Z1_KEYWORD_CALLBACK( "shareddict", parse_shared_dict ), #endif - T1_KEYWORD_CALLBACK( 0, 0 ) + Z1_KEYWORD_CALLBACK( 0, 0 ) }; static FT_Error parse_dict( T1_Face face, - T1_Loader* loader, + Z1_Loader* loader, FT_Byte* base, FT_Long size ) { - T1_Parser* parser = &loader->parser; + Z1_Parser* parser = &loader->parser; parser->cursor = base; parser->limit = base + size; @@ -1257,12 +1257,12 @@ if (cur < limit) { - T1_Token_Rec token; + Z1_Token_Rec token; /* skip the "known" keyword and the token following it */ cur += 5; loader->parser.cursor = cur; - T1_ToToken( &loader->parser, &token ); + Z1_ToToken( &loader->parser, &token ); /* if the last token was an array, skip it !! */ if (token.type == t1_token_array) @@ -1291,7 +1291,7 @@ else { /* now, compare the immediate name to the keyword table */ - T1_KeyWord* keyword = (T1_KeyWord*)t1_keywords; + Z1_KeyWord* keyword = (Z1_KeyWord*)t1_keywords; for (;;) { @@ -1332,7 +1332,7 @@ } static - void t1_init_loader( T1_Loader* loader, T1_Face face ) + void t1_init_loader( Z1_Loader* loader, T1_Face face ) { UNUSED(face); @@ -1349,25 +1349,25 @@ } static - void t1_done_loader( T1_Loader* loader ) + void t1_done_loader( Z1_Loader* loader ) { - T1_Parser* parser = &loader->parser; + Z1_Parser* parser = &loader->parser; /* finalize tables */ - T1_Release_Table( &loader->encoding_table ); - T1_Release_Table( &loader->charstrings ); - T1_Release_Table( &loader->glyph_names ); - T1_Release_Table( &loader->subrs ); + Z1_Release_Table( &loader->encoding_table ); + Z1_Release_Table( &loader->charstrings ); + Z1_Release_Table( &loader->glyph_names ); + Z1_Release_Table( &loader->subrs ); /* finalize parser */ - T1_Done_Parser( parser ); + Z1_Done_Parser( parser ); } LOCAL_FUNC - FT_Error T1_Open_Face( T1_Face face ) + FT_Error Z1_Open_Face( T1_Face face ) { - T1_Loader loader; - T1_Parser* parser; + Z1_Loader loader; + Z1_Parser* parser; T1_Font* type1 = &face->type1; FT_Error error; @@ -1377,13 +1377,13 @@ type1->private_dict.lenIV = 4; parser = &loader.parser; - error = T1_New_Parser( parser, face->root.stream, face->root.memory ); + error = Z1_New_Parser( parser, face->root.stream, face->root.memory ); if (error) goto Exit; error = parse_dict( face, &loader, parser->base_dict, parser->base_len ); if (error) goto Exit; - error = T1_Get_Private_Dict( parser ); + error = Z1_Get_Private_Dict( parser ); if (error) goto Exit; error = parse_dict( face, &loader, parser->private_dict, parser->private_len ); diff --git a/src/type1z/t1load.h b/src/type1z/z1load.h similarity index 72% rename from src/type1z/t1load.h rename to src/type1z/z1load.h index e4a667656..bf2333cf5 100644 --- a/src/type1z/t1load.h +++ b/src/type1z/z1load.h @@ -21,50 +21,50 @@ #include #include #include -#include +#include #ifdef __cplusplus extern "C" { #endif - typedef struct T1_Loader_ + typedef struct Z1_Loader_ { - T1_Parser parser; /* parser used to read the stream */ + Z1_Parser parser; /* parser used to read the stream */ FT_Int num_chars; /* number of characters in encoding */ - T1_Table encoding_table; /* T1_Table used to store the */ + Z1_Table encoding_table; /* Z1_Table used to store the */ /* encoding character names */ FT_Int num_glyphs; - T1_Table glyph_names; - T1_Table charstrings; + Z1_Table glyph_names; + Z1_Table charstrings; FT_Int num_subrs; - T1_Table subrs; + Z1_Table subrs; FT_Bool fontdata; - } T1_Loader; + } Z1_Loader; LOCAL_DEF - FT_Error T1_Open_Face( T1_Face face ); + FT_Error Z1_Open_Face( T1_Face face ); -#ifndef T1_CONFIG_OPTION_NO_MM_SUPPORT +#ifndef Z1_CONFIG_OPTION_NO_MM_SUPPORT LOCAL_DEF - FT_Error T1_Get_Multi_Master( T1_Face face, + FT_Error Z1_Get_Multi_Master( T1_Face face, FT_Multi_Master* master ); LOCAL_DEF - FT_Error T1_Set_MM_Blend( T1_Face face, + FT_Error Z1_Set_MM_Blend( T1_Face face, FT_UInt num_coords, FT_Fixed* coords ); LOCAL_DEF - FT_Error T1_Set_MM_Design( T1_Face face, + FT_Error Z1_Set_MM_Design( T1_Face face, FT_UInt num_coords, FT_Long* coords ); LOCAL_DEF - void T1_Done_Blend( T1_Face face ); + void Z1_Done_Blend( T1_Face face ); #endif #ifdef __cplusplus diff --git a/src/type1z/t1objs.c b/src/type1z/z1objs.c similarity index 93% rename from src/type1z/t1objs.c rename to src/type1z/z1objs.c index 0bfa77419..27e022ce3 100644 --- a/src/type1z/t1objs.c +++ b/src/type1z/z1objs.c @@ -18,10 +18,10 @@ #include #include -#include -#include +#include +#include #include -#include +#include /* Required by tracing mode */ #undef FT_COMPONENT @@ -36,7 +36,7 @@ /******************************************************************* * - * T1_Done_Face + * Z1_Done_Face * * * The face object destructor. @@ -50,7 +50,7 @@ ******************************************************************/ LOCAL_FUNC - void T1_Done_Face( T1_Face face ) + void Z1_Done_Face( T1_Face face ) { FT_Memory memory; T1_Font* type1 = &face->type1; @@ -59,9 +59,9 @@ { memory = face->root.memory; -#ifndef T1_CONFIG_OPTION_NO_MM_SUPPORT +#ifndef Z1_CONFIG_OPTION_NO_MM_SUPPORT /* release multiple masters information */ - T1_Done_Blend( face ); + Z1_Done_Blend( face ); face->blend = 0; #endif @@ -91,10 +91,10 @@ FREE( type1->encoding.char_index ); FREE( type1->font_name ); -#ifndef T1_CONFIG_OPTION_NO_AFM +#ifndef Z1_CONFIG_OPTION_NO_AFM /* release afm data if present */ if ( face->afm_data) - T1_Done_AFM( memory, (T1_AFM*)face->afm_data ); + Z1_Done_AFM( memory, (Z1_AFM*)face->afm_data ); #endif /* release unicode map, if any */ @@ -108,7 +108,7 @@ /******************************************************************* * - * T1_Init_Face + * Z1_Init_Face * * * The face object constructor. @@ -123,7 +123,7 @@ ******************************************************************/ LOCAL_FUNC - FT_Error T1_Init_Face( FT_Stream stream, + FT_Error Z1_Init_Face( FT_Stream stream, T1_Face face, FT_Int face_index, FT_Int num_params, @@ -149,7 +149,7 @@ } /* open the tokenizer, this will also check the font format */ - error = T1_Open_Face( face ); + error = Z1_Open_Face( face ); if (error) goto Exit; /* if we just wanted to check the format, leave successfully now */ @@ -232,7 +232,7 @@ { FT_Int max_advance; - error = T1_Compute_Max_Advance( face, &max_advance ); + error = Z1_Compute_Max_Advance( face, &max_advance ); /* in case of error, keep the standard width */ if (!error) @@ -317,7 +317,7 @@ /******************************************************************* * - * T1_Init_Driver + * Z1_Init_Driver * * * Initialise a given Type 1 driver object @@ -331,7 +331,7 @@ ******************************************************************/ LOCAL_FUNC - FT_Error T1_Init_Driver( T1_Driver driver ) + FT_Error Z1_Init_Driver( Z1_Driver driver ) { UNUSED(driver); return T1_Err_Ok; @@ -341,7 +341,7 @@ /******************************************************************* * - * T1_Done_Driver + * Z1_Done_Driver * * * finalise a given Type 1 driver @@ -352,7 +352,7 @@ ******************************************************************/ LOCAL_DEF - void T1_Done_Driver( T1_Driver driver ) + void Z1_Done_Driver( Z1_Driver driver ) { UNUSED(driver); } diff --git a/src/type1z/t1objs.h b/src/type1z/z1objs.h similarity index 84% rename from src/type1z/t1objs.h rename to src/type1z/z1objs.h index 867f23c2b..6d555ebd9 100644 --- a/src/type1z/t1objs.h +++ b/src/type1z/z1objs.h @@ -28,42 +28,42 @@ #endif /* 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 Z1_Size_Hints_ Z1_Size_Hints; + typedef struct Z1_Glyph_Hints_ Z1_Glyph_Hints; /***********************************************************************/ /* */ - /* T1_Driver */ + /* Z1_Driver */ /* */ /* */ /* A handle to a Type 1 driver object. */ /* */ - typedef struct T1_DriverRec_ *T1_Driver; + typedef struct Z1_DriverRec_ *Z1_Driver; /***********************************************************************/ /* */ - /* T1_Size */ + /* Z1_Size */ /* */ /* */ /* A handle to a Type 1 size object. */ /* */ - typedef struct T1_SizeRec_* T1_Size; + typedef struct Z1_SizeRec_* Z1_Size; /***********************************************************************/ /* */ - /* T1_GlyphSlot */ + /* Z1_GlyphSlot */ /* */ /* */ /* A handle to a Type 1 glyph slot object. */ /* */ - typedef struct T1_GlyphSlotRec_* T1_GlyphSlot; + typedef struct Z1_GlyphSlotRec_* Z1_GlyphSlot; /***********************************************************************/ /* */ - /* T1_CharMap */ + /* Z1_CharMap */ /* */ /* */ /* A handle to a Type 1 character mapping object. */ @@ -73,7 +73,7 @@ /* The driver is responsible for making up charmap objects */ /* corresponding to these tables.. */ /* */ - typedef struct T1_CharMapRec_* T1_CharMap; + typedef struct Z1_CharMapRec_* Z1_CharMap; @@ -86,31 +86,31 @@ /***************************************************/ /* */ - /* T1_Size : */ + /* Z1_Size : */ /* */ /* Type 1 size record.. */ /* */ - typedef struct T1_SizeRec_ + typedef struct Z1_SizeRec_ { FT_SizeRec root; FT_Bool valid; - T1_Size_Hints* hints; /* defined in the hinter. This allows */ + Z1_Size_Hints* hints; /* defined in the hinter. This allows */ /* us to experiment with different */ /* hinting schemes without having to */ /* change 't1objs' each time.. */ - } T1_SizeRec; + } Z1_SizeRec; /***************************************************/ /* */ - /* T1_GlyphSlot : */ + /* Z1_GlyphSlot : */ /* */ /* TrueDoc glyph record.. */ /* */ - typedef struct T1_GlyphSlotRec_ + typedef struct Z1_GlyphSlotRec_ { FT_GlyphSlotRec root; @@ -123,14 +123,14 @@ FT_Fixed x_scale; FT_Fixed y_scale; - T1_Glyph_Hints* hints; /* defined in the hinter */ + Z1_Glyph_Hints* hints; /* defined in the hinter */ - } T1_GlyphSlotRec; + } Z1_GlyphSlotRec; /******************************************************************* * - * T1_Init_Face + * Z1_Init_Face * * * Initialise a given Type 1 face object @@ -146,7 +146,7 @@ ******************************************************************/ LOCAL_DEF - FT_Error T1_Init_Face( FT_Stream stream, + FT_Error Z1_Init_Face( FT_Stream stream, T1_Face face, FT_Int face_index, FT_Int num_params, @@ -156,7 +156,7 @@ /******************************************************************* * - * T1_Done_Face + * Z1_Done_Face * * * Finalise a given face object @@ -167,12 +167,12 @@ ******************************************************************/ LOCAL_DEF - void T1_Done_Face( T1_Face face ); + void Z1_Done_Face( T1_Face face ); /******************************************************************* * - * T1_Init_Driver + * Z1_Init_Driver * * * Initialise a given Type 1 driver object @@ -186,13 +186,13 @@ ******************************************************************/ LOCAL_DEF - FT_Error T1_Init_Driver( T1_Driver driver ); + FT_Error Z1_Init_Driver( Z1_Driver driver ); /******************************************************************* * - * T1_Done_Driver + * Z1_Done_Driver * * * finalise a given Type 1 driver @@ -203,7 +203,7 @@ ******************************************************************/ LOCAL_DEF - void T1_Done_Driver( T1_Driver driver ); + void Z1_Done_Driver( Z1_Driver driver ); #ifdef __cplusplus } diff --git a/src/type1z/t1parse.c b/src/type1z/z1parse.c similarity index 92% rename from src/type1z/t1parse.c rename to src/type1z/z1parse.c index c4a033953..992d39b2b 100644 --- a/src/type1z/t1parse.c +++ b/src/type1z/z1parse.c @@ -16,7 +16,7 @@ * The Type 1 parser is in charge of the following: * * - provide an implementation of a growing sequence of - * objects called a T1_Table (used to build various tables + * objects called a Z1_Table (used to build various tables * needed by the loader). * * - opening .pfb and .pfa files to extract their top-level @@ -33,7 +33,7 @@ #include #include #include -#include +#include #undef FT_COMPONENT #define FT_COMPONENT trace_t1load @@ -42,7 +42,7 @@ /*************************************************************************/ /*************************************************************************/ /***** *****/ -/***** IMPLEMENTATION OF T1_TABLE OBJECT *****/ +/***** IMPLEMENTATION OF Z1_TABLE OBJECT *****/ /***** *****/ /***** *****/ /*************************************************************************/ @@ -52,10 +52,10 @@ /*************************************************************************/ /* */ -/* T1_New_Table */ +/* Z1_New_Table */ /* */ /* */ -/* Initialise a T1_Table. */ +/* Initialise a Z1_Table. */ /* */ /* */ /* table :: address of target table */ @@ -67,7 +67,7 @@ /* */ LOCAL_FUNC - FT_Error T1_New_Table( T1_Table* table, + FT_Error Z1_New_Table( Z1_Table* table, FT_Int count, FT_Memory memory ) { @@ -95,10 +95,10 @@ /*************************************************************************/ /* */ -/* T1_Add_Table */ +/* Z1_Add_Table */ /* */ /* */ -/* Adds an object to a T1_Table, possibly growing its memory block */ +/* Adds an object to a Z1_Table, possibly growing its memory block */ /* */ /* */ /* table :: target table */ @@ -112,7 +112,7 @@ /* */ - static void shift_elements( T1_Table* table, FT_Byte* old_base ) + static void shift_elements( Z1_Table* table, FT_Byte* old_base ) { FT_Long delta = table->block - old_base; FT_Byte** offset = table->elements; @@ -127,7 +127,7 @@ } static - FT_Error reallocate_t1_table( T1_Table* table, + FT_Error reallocate_t1_table( Z1_Table* table, FT_Int new_size ) { FT_Memory memory = table->memory; @@ -150,7 +150,7 @@ LOCAL_FUNC - FT_Error T1_Add_Table( T1_Table* table, + FT_Error Z1_Add_Table( Z1_Table* table, FT_Int index, void* object, FT_Int length ) @@ -186,10 +186,10 @@ /*************************************************************************/ /* */ -/* T1_Done_Table */ +/* Z1_Done_Table */ /* */ /* */ -/* Finalise a T1_Table. (realloc it to its current cursor). */ +/* Finalise a Z1_Table. (realloc it to its current cursor). */ /* */ /* */ /* table :: target table */ @@ -200,7 +200,7 @@ /* */ #if 0 LOCAL_FUNC - void T1_Done_Table( T1_Table* table ) + void Z1_Done_Table( Z1_Table* table ) { FT_Memory memory = table->memory; FT_Error error; @@ -220,7 +220,7 @@ #endif LOCAL_FUNC - void T1_Release_Table( T1_Table* table ) + void Z1_Release_Table( Z1_Table* table ) { FT_Memory memory = table->memory; @@ -244,13 +244,13 @@ /*************************************************************************/ /*************************************************************************/ - #define IS_T1_WHITESPACE(c) ( (c) == ' ' || (c) == '\t' ) - #define IS_T1_LINESPACE(c) ( (c) == '\r' || (c) == '\n' ) + #define IS_Z1_WHITESPACE(c) ( (c) == ' ' || (c) == '\t' ) + #define IS_Z1_LINESPACE(c) ( (c) == '\r' || (c) == '\n' ) - #define IS_T1_SPACE(c) ( IS_T1_WHITESPACE(c) || IS_T1_LINESPACE(c) ) + #define IS_Z1_SPACE(c) ( IS_Z1_WHITESPACE(c) || IS_Z1_LINESPACE(c) ) LOCAL_FUNC - void T1_Skip_Spaces( T1_Parser* parser ) + void Z1_Skip_Spaces( Z1_Parser* parser ) { FT_Byte* cur = parser->cursor; FT_Byte* limit = parser->limit; @@ -258,7 +258,7 @@ while (cur < limit) { FT_Byte c = *cur; - if (!IS_T1_SPACE(c)) + if (!IS_Z1_SPACE(c)) break; cur++; } @@ -266,8 +266,8 @@ } LOCAL_FUNC - void T1_ToToken( T1_Parser* parser, - T1_Token_Rec* token ) + void Z1_ToToken( Z1_Parser* parser, + Z1_Token_Rec* token ) { FT_Byte* cur; FT_Byte* limit; @@ -279,7 +279,7 @@ token->limit = 0; /* first of all, skip space */ - T1_Skip_Spaces(parser); + Z1_Skip_Spaces(parser); cur = parser->cursor; limit = parser->limit; @@ -330,7 +330,7 @@ default: token->start = cur++; token->type = t1_token_any; - while (cur < limit && !IS_T1_SPACE(*cur)) + while (cur < limit && !IS_Z1_SPACE(*cur)) cur++; token->limit = cur; @@ -348,31 +348,31 @@ LOCAL_FUNC - void T1_ToTokenArray( T1_Parser* parser, - T1_Token_Rec* tokens, + void Z1_ToTokenArray( Z1_Parser* parser, + Z1_Token_Rec* tokens, FT_UInt max_tokens, FT_Int *pnum_tokens ) { - T1_Token_Rec master; + Z1_Token_Rec master; *pnum_tokens = -1; - T1_ToToken( parser, &master ); + Z1_ToToken( parser, &master ); if (master.type == t1_token_array) { FT_Byte* old_cursor = parser->cursor; FT_Byte* old_limit = parser->limit; - T1_Token_Rec* cur = tokens; - T1_Token_Rec* limit = cur + max_tokens; + Z1_Token_Rec* cur = tokens; + Z1_Token_Rec* limit = cur + max_tokens; parser->cursor = master.start; parser->limit = master.limit; while (parser->cursor < parser->limit) { - T1_Token_Rec token; + Z1_Token_Rec token; - T1_ToToken( parser, &token ); + Z1_ToToken( parser, &token ); if (!token.type) break; @@ -707,20 +707,20 @@ /* Loads a simple field (i.e. non-table) into the current list of objects */ LOCAL_FUNC - FT_Error T1_Load_Field( T1_Parser* parser, - const T1_Field_Rec* field, + FT_Error Z1_Load_Field( Z1_Parser* parser, + const Z1_Field_Rec* field, void** objects, FT_UInt max_objects, FT_ULong* pflags ) { - T1_Token_Rec token; + Z1_Token_Rec token; FT_Byte* cur; FT_Byte* limit; FT_UInt count; FT_UInt index; FT_Error error; - T1_ToToken( parser, &token ); + Z1_ToToken( parser, &token ); if (!token.type) goto Fail; @@ -807,21 +807,21 @@ #define T1_MAX_TABLE_ELEMENTS 32 LOCAL_FUNC - FT_Error T1_Load_Field_Table( T1_Parser* parser, - const T1_Field_Rec* field, + FT_Error Z1_Load_Field_Table( Z1_Parser* parser, + const Z1_Field_Rec* field, void** objects, FT_UInt max_objects, FT_ULong* pflags ) { - T1_Token_Rec elements[T1_MAX_TABLE_ELEMENTS]; - T1_Token_Rec* token; + Z1_Token_Rec elements[T1_MAX_TABLE_ELEMENTS]; + Z1_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; + Z1_Field_Rec fieldrec = *(Z1_Field_Rec*)field; - T1_ToTokenArray( parser, elements, 32, &num_elements ); + Z1_ToTokenArray( parser, elements, 32, &num_elements ); if (num_elements < 0) goto Fail; @@ -840,7 +840,7 @@ { parser->cursor = token->start; parser->limit = token->limit; - T1_Load_Field( parser, &fieldrec, objects, max_objects, 0 ); + Z1_Load_Field( parser, &fieldrec, objects, max_objects, 0 ); fieldrec.offset += fieldrec.size; } @@ -864,21 +864,21 @@ LOCAL_FUNC - FT_Long T1_ToInt ( T1_Parser* parser ) + FT_Long Z1_ToInt ( Z1_Parser* parser ) { return t1_toint( &parser->cursor, parser->limit ); } LOCAL_FUNC - FT_Long T1_ToFixed( T1_Parser* parser, FT_Int power_ten ) + FT_Long Z1_ToFixed( Z1_Parser* parser, FT_Int power_ten ) { return t1_tofixed( &parser->cursor, parser->limit, power_ten ); } LOCAL_FUNC - FT_Int T1_ToCoordArray( T1_Parser* parser, + FT_Int Z1_ToCoordArray( Z1_Parser* parser, FT_Int max_coords, FT_Short* coords ) { @@ -887,7 +887,7 @@ LOCAL_FUNC - FT_Int T1_ToFixedArray( T1_Parser* parser, + FT_Int Z1_ToFixedArray( Z1_Parser* parser, FT_Int max_values, FT_Fixed* values, FT_Int power_ten ) @@ -898,14 +898,14 @@ #if 0 LOCAL_FUNC - FT_String* T1_ToString( T1_Parser* parser ) + FT_String* Z1_ToString( Z1_Parser* parser ) { return t1_tostring( &parser->cursor, parser->limit, parser->memory ); } LOCAL_FUNC - FT_Bool T1_ToBool( T1_Parser* parser ) + FT_Bool Z1_ToBool( Z1_Parser* parser ) { return t1_tobool( &parser->cursor, parser->limit ); } @@ -938,7 +938,7 @@ LOCAL_FUNC - FT_Error T1_New_Parser( T1_Parser* parser, + FT_Error Z1_New_Parser( Z1_Parser* parser, FT_Stream stream, FT_Memory memory ) { @@ -1041,7 +1041,7 @@ LOCAL_FUNC - void T1_Done_Parser( T1_Parser* parser ) + void Z1_Done_Parser( Z1_Parser* parser ) { FT_Memory memory = parser->memory; @@ -1074,7 +1074,7 @@ LOCAL_FUNC - void T1_Decrypt( FT_Byte* buffer, + void Z1_Decrypt( FT_Byte* buffer, FT_Int length, FT_UShort seed ) { @@ -1091,7 +1091,7 @@ LOCAL_FUNC - FT_Error T1_Get_Private_Dict( T1_Parser* parser ) + FT_Error Z1_Get_Private_Dict( Z1_Parser* parser ) { FT_Stream stream = parser->stream; FT_Memory memory = parser->memory; @@ -1258,7 +1258,7 @@ } /* we now decrypt the encoded binary private dictionary */ - T1_Decrypt( parser->private_dict, parser->private_len, 55665 ); + Z1_Decrypt( parser->private_dict, parser->private_len, 55665 ); parser->cursor = parser->private_dict; parser->limit = parser->cursor + parser->private_len; diff --git a/src/type1z/t1parse.h b/src/type1z/z1parse.h similarity index 67% rename from src/type1z/t1parse.h rename to src/type1z/z1parse.h index e14728b7c..d0d1b87f4 100644 --- a/src/type1z/t1parse.h +++ b/src/type1z/z1parse.h @@ -16,7 +16,7 @@ * The Type 1 parser is in charge of the following: * * - provide an implementation of a growing sequence of - * objects called a T1_Table (used to build various tables + * objects called a Z1_Table (used to build various tables * needed by the loader). * * - opening .pfb and .pfa files to extract their top-level @@ -39,7 +39,7 @@ /* simple enumeration type used to identify token types */ - typedef enum T1_Token_Type_ + typedef enum Z1_Token_Type_ { t1_token_none = 0, t1_token_any, @@ -49,19 +49,19 @@ /* do not remove */ t1_token_max - } T1_Token_Type; + } Z1_Token_Type; /* a simple structure used to identify tokens */ - typedef struct T1_Token_Rec_ + typedef struct Z1_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.. */ + Z1_Token_Type type; /* type of token.. */ - } T1_Token_Rec; + } Z1_Token_Rec; /* enumeration type used to identify object fields */ - typedef enum T1_Field_Type_ + typedef enum Z1_Field_Type_ { t1_field_none = 0, t1_field_bool, @@ -74,73 +74,73 @@ /* do not remove */ t1_field_max - } T1_Field_Type; + } Z1_Field_Type; /* structure type used to model object fields */ - typedef struct T1_Field_Rec_ + typedef struct Z1_Field_Rec_ { - T1_Field_Type type; /* type of field */ + Z1_Field_Type type; /* type of field */ FT_UInt offset; /* offset of field in object */ FT_UInt size; /* size of field in bytes */ FT_UInt array_max; /* maximum number of elements for array */ FT_UInt count_offset; /* offset of element count for arrays */ FT_Int flag_bit; /* bit number for field flag */ - } T1_Field_Rec; + } Z1_Field_Rec; -#define T1_FIELD_REF(s,f) (((s*)0)->f) +#define Z1_FIELD_REF(s,f) (((s*)0)->f) -#define T1_FIELD_BOOL( _ftype, _fname ) \ +#define Z1_FIELD_BOOL( _ftype, _fname ) \ { t1_field_bool, \ - (FT_UInt)(char*)&T1_FIELD_REF(_ftype,_fname), \ - sizeof(T1_FIELD_REF(_ftype,_fname)), \ + (FT_UInt)(char*)&Z1_FIELD_REF(_ftype,_fname), \ + sizeof(Z1_FIELD_REF(_ftype,_fname)), \ 0, 0, 0 } -#define T1_FIELD_NUM( _ftype, _fname ) \ +#define Z1_FIELD_NUM( _ftype, _fname ) \ { t1_field_integer, \ - (FT_UInt)(char*)&T1_FIELD_REF(_ftype,_fname), \ - sizeof(T1_FIELD_REF(_ftype,_fname)), \ + (FT_UInt)(char*)&Z1_FIELD_REF(_ftype,_fname), \ + sizeof(Z1_FIELD_REF(_ftype,_fname)), \ 0, 0, 0 } -#define T1_FIELD_FIXED( _ftype, _fname, _power ) \ +#define Z1_FIELD_FIXED( _ftype, _fname, _power ) \ { t1_field_fixed, \ - (FT_UInt)(char*)&T1_FIELD_REF(_ftype,_fname), \ - sizeof(T1_FIELD_REF(_ftype,_fname)), \ + (FT_UInt)(char*)&Z1_FIELD_REF(_ftype,_fname), \ + sizeof(Z1_FIELD_REF(_ftype,_fname)), \ 0, 0, 0 } -#define T1_FIELD_STRING( _ftype, _fname ) \ +#define Z1_FIELD_STRING( _ftype, _fname ) \ { t1_field_string, \ - (FT_UInt)(char*)&T1_FIELD_REF(_ftype,_fname), \ - sizeof(T1_FIELD_REF(_ftype,_fname)), \ + (FT_UInt)(char*)&Z1_FIELD_REF(_ftype,_fname), \ + sizeof(Z1_FIELD_REF(_ftype,_fname)), \ 0, 0, 0 } -#define T1_FIELD_NUM_ARRAY( _ftype, _fname, _fcount, _fmax ) \ +#define Z1_FIELD_NUM_ARRAY( _ftype, _fname, _fcount, _fmax ) \ { t1_field_integer, \ - (FT_UInt)(char*)&T1_FIELD_REF(_ftype,_fname), \ - sizeof(T1_FIELD_REF(_ftype,_fname)[0]), \ + (FT_UInt)(char*)&Z1_FIELD_REF(_ftype,_fname), \ + sizeof(Z1_FIELD_REF(_ftype,_fname)[0]), \ _fmax, \ - (FT_UInt)(char*)&T1_FIELD_REF(_ftype,_fcount), \ + (FT_UInt)(char*)&Z1_FIELD_REF(_ftype,_fcount), \ 0 } -#define T1_FIELD_FIXED_ARRAY( _ftype, _fname, _fcount, _fmax ) \ +#define Z1_FIELD_FIXED_ARRAY( _ftype, _fname, _fcount, _fmax ) \ { t1_field_fixed, \ - (FT_UInt)(char*)&T1_FIELD_REF(_ftype,_fname), \ - sizeof(T1_FIELD_REF(_ftype,_fname)[0]), \ + (FT_UInt)(char*)&Z1_FIELD_REF(_ftype,_fname), \ + sizeof(Z1_FIELD_REF(_ftype,_fname)[0]), \ _fmax, \ - (FT_UInt)(char*)&T1_FIELD_REF(_ftype,_fcount), \ + (FT_UInt)(char*)&Z1_FIELD_REF(_ftype,_fcount), \ 0 } -#define T1_FIELD_NUM_ARRAY2( _ftype, _fname, _fmax ) \ +#define Z1_FIELD_NUM_ARRAY2( _ftype, _fname, _fmax ) \ { t1_field_integer, \ - (FT_UInt)(char*)&T1_FIELD_REF(_ftype,_fname), \ - sizeof(T1_FIELD_REF(_ftype,_fname)[0]), \ + (FT_UInt)(char*)&Z1_FIELD_REF(_ftype,_fname), \ + sizeof(Z1_FIELD_REF(_ftype,_fname)[0]), \ _fmax, \ 0, 0 } -#define T1_FIELD_FIXED_ARRAY2( _ftype, _fname, _fmax ) \ +#define Z1_FIELD_FIXED_ARRAY2( _ftype, _fname, _fmax ) \ { t1_field_fixed, \ - (FT_UInt)(char*)&T1_FIELD_REF(_ftype,_fname), \ - sizeof(T1_FIELD_REF(_ftype,_fname)[0]), \ + (FT_UInt)(char*)&Z1_FIELD_REF(_ftype,_fname), \ + sizeof(Z1_FIELD_REF(_ftype,_fname)[0]), \ _fmax, \ 0, 0 } @@ -148,10 +148,10 @@ /************************************************************************* * - * T1_Table + * Z1_Table * * - * A T1_Table is a simple object used to store an array of objects + * A Z1_Table is a simple object used to store an array of objects * in a single memory block. * * @@ -175,7 +175,7 @@ * memory :: memory object used for memory operations (alloc/realloc) */ - typedef struct T1_Table_ + typedef struct Z1_Table_ { FT_Byte* block; /* current memory block */ FT_Int cursor; /* current cursor in memory block */ @@ -189,15 +189,15 @@ FT_Memory memory; - } T1_Table; + } Z1_Table; /************************************************************************* * - * T1_Parser + * Z1_Parser * * - * A T1_Parser is an object used to parse a Type 1 fonts very + * A Z1_Parser is an object used to parse a Type 1 fonts very * quickly. * * @@ -221,7 +221,7 @@ * * error :: current parsing error */ - typedef struct T1_Parser_ + typedef struct Z1_Parser_ { FT_Stream stream; FT_Memory memory; @@ -240,52 +240,52 @@ FT_Byte* limit; FT_Error error; - } T1_Parser; + } Z1_Parser; LOCAL_DEF - FT_Error T1_New_Table( T1_Table* table, + FT_Error Z1_New_Table( Z1_Table* table, FT_Int count, FT_Memory memory ); LOCAL_DEF - FT_Error T1_Add_Table( T1_Table* table, + FT_Error Z1_Add_Table( Z1_Table* table, FT_Int index, void* object, FT_Int length ); #if 0 LOCAL_DEF - void T1_Done_Table( T1_Table* table ); + void Z1_Done_Table( Z1_Table* table ); #endif LOCAL_DEF - void T1_Release_Table( T1_Table* table ); + void Z1_Release_Table( Z1_Table* table ); LOCAL_DEF - FT_Long T1_ToInt ( T1_Parser* parser ); + FT_Long Z1_ToInt ( Z1_Parser* parser ); LOCAL_DEF - FT_Long T1_ToFixed( T1_Parser* parser, FT_Int power_ten ); + FT_Long Z1_ToFixed( Z1_Parser* parser, FT_Int power_ten ); LOCAL_DEF - FT_Int T1_ToCoordArray( T1_Parser* parser, + FT_Int Z1_ToCoordArray( Z1_Parser* parser, FT_Int max_coords, FT_Short* coords ); LOCAL_DEF - FT_Int T1_ToFixedArray( T1_Parser* parser, + FT_Int Z1_ToFixedArray( Z1_Parser* parser, FT_Int max_values, FT_Fixed* values, FT_Int power_ten ); #if 0 LOCAL_DEF - FT_String* T1_ToString( T1_Parser* parser ); + FT_String* Z1_ToString( Z1_Parser* parser ); LOCAL_DEF - FT_Bool T1_ToBool( T1_Parser* parser ); + FT_Bool Z1_ToBool( Z1_Parser* parser ); #endif @@ -294,48 +294,48 @@ LOCAL_DEF - void T1_Skip_Spaces( T1_Parser* parser ); + void Z1_Skip_Spaces( Z1_Parser* parser ); LOCAL_DEF - void T1_ToToken( T1_Parser* parser, - T1_Token_Rec* token ); + void Z1_ToToken( Z1_Parser* parser, + Z1_Token_Rec* token ); LOCAL_FUNC - void T1_ToTokenArray( T1_Parser* parser, - T1_Token_Rec* tokens, + void Z1_ToTokenArray( Z1_Parser* parser, + Z1_Token_Rec* tokens, FT_UInt max_tokens, FT_Int* pnum_tokens ); LOCAL_DEF - FT_Error T1_Load_Field( T1_Parser* parser, - const T1_Field_Rec* field, + FT_Error Z1_Load_Field( Z1_Parser* parser, + const Z1_Field_Rec* field, void** objects, FT_UInt max_objects, FT_ULong* pflags ); LOCAL_DEF - FT_Error T1_Load_Field_Table( T1_Parser* parser, - const T1_Field_Rec* field, + FT_Error Z1_Load_Field_Table( Z1_Parser* parser, + const Z1_Field_Rec* field, void** objects, FT_UInt max_objects, FT_ULong* pflags ); LOCAL_DEF - FT_Error T1_New_Parser( T1_Parser* parser, + FT_Error Z1_New_Parser( Z1_Parser* parser, FT_Stream stream, FT_Memory memory ); LOCAL_DEF - FT_Error T1_Get_Private_Dict( T1_Parser* parser ); + FT_Error Z1_Get_Private_Dict( Z1_Parser* parser ); LOCAL_DEF - void T1_Decrypt( FT_Byte* buffer, + void Z1_Decrypt( FT_Byte* buffer, FT_Int length, FT_UShort seed ); LOCAL_DEF - void T1_Done_Parser( T1_Parser* parser ); + void Z1_Done_Parser( Z1_Parser* parser ); #ifdef __cplusplus } diff --git a/src/type1z/t1tokens.h b/src/type1z/z1tokens.h similarity index 66% rename from src/type1z/t1tokens.h rename to src/type1z/z1tokens.h index e3a88da8f..8a7182916 100644 --- a/src/type1z/t1tokens.h +++ b/src/type1z/z1tokens.h @@ -20,47 +20,47 @@ #undef T1TYPE #define T1TYPE T1_FontInfo - T1_FONTINFO_STRING( "version", version ) - T1_FONTINFO_STRING( "Notice", notice ) - T1_FONTINFO_STRING( "FullName", full_name ) - T1_FONTINFO_STRING( "FamilyName", family_name ) - T1_FONTINFO_STRING( "Weight", weight ) + Z1_FONTINFO_STRING( "version", version ) + Z1_FONTINFO_STRING( "Notice", notice ) + Z1_FONTINFO_STRING( "FullName", full_name ) + Z1_FONTINFO_STRING( "FamilyName", family_name ) + Z1_FONTINFO_STRING( "Weight", weight ) - T1_FONTINFO_NUM( "ItalicAngle", italic_angle ) - T1_FONTINFO_BOOL( "isFixedPitch", is_fixed_pitch ) - T1_FONTINFO_NUM( "UnderlinePosition", underline_position ) - T1_FONTINFO_NUM( "UnderlineThickness", underline_thickness ) + Z1_FONTINFO_NUM( "ItalicAngle", italic_angle ) + Z1_FONTINFO_BOOL( "isFixedPitch", is_fixed_pitch ) + Z1_FONTINFO_NUM( "UnderlinePosition", underline_position ) + Z1_FONTINFO_NUM( "UnderlineThickness", underline_thickness ) #undef T1TYPE #define T1TYPE T1_Private - T1_PRIVATE_NUM ( "UniqueID", unique_id ) - T1_PRIVATE_NUM ( "lenIV", lenIV ) - T1_PRIVATE_NUM ( "LanguageGroup", language_group ) - T1_PRIVATE_NUM ( "password", password ) + Z1_PRIVATE_NUM ( "UniqueID", unique_id ) + Z1_PRIVATE_NUM ( "lenIV", lenIV ) + Z1_PRIVATE_NUM ( "LanguageGroup", language_group ) + Z1_PRIVATE_NUM ( "password", password ) - T1_PRIVATE_FIXED( "BlueScale", blue_scale ) - T1_PRIVATE_NUM ( "BlueShift", blue_shift ) - T1_PRIVATE_NUM ( "BlueFuzz", blue_fuzz ) + Z1_PRIVATE_FIXED( "BlueScale", blue_scale ) + Z1_PRIVATE_NUM ( "BlueShift", blue_shift ) + Z1_PRIVATE_NUM ( "BlueFuzz", blue_fuzz ) - T1_PRIVATE_NUM_TABLE( "BlueValues", blue_values, 14, num_blue_values ) - T1_PRIVATE_NUM_TABLE( "OtherBlues", other_blues, 10, num_other_blues ) - T1_PRIVATE_NUM_TABLE( "FamilyBlues", family_blues, 14, num_family_blues ) - T1_PRIVATE_NUM_TABLE( "FamilyOtherBlues", family_other_blues, 10, num_family_other_blues ) + Z1_PRIVATE_NUM_TABLE( "BlueValues", blue_values, 14, num_blue_values ) + Z1_PRIVATE_NUM_TABLE( "OtherBlues", other_blues, 10, num_other_blues ) + Z1_PRIVATE_NUM_TABLE( "FamilyBlues", family_blues, 14, num_family_blues ) + Z1_PRIVATE_NUM_TABLE( "FamilyOtherBlues", family_other_blues, 10, num_family_other_blues ) - T1_PRIVATE_NUM_TABLE2( "StdHW", standard_width, 1 ) - T1_PRIVATE_NUM_TABLE2( "StdVW", standard_height, 1 ) - T1_PRIVATE_NUM_TABLE2( "MinFeature", min_feature, 2 ) + Z1_PRIVATE_NUM_TABLE2( "StdHW", standard_width, 1 ) + Z1_PRIVATE_NUM_TABLE2( "StdVW", standard_height, 1 ) + Z1_PRIVATE_NUM_TABLE2( "MinFeature", min_feature, 2 ) - T1_PRIVATE_NUM_TABLE ( "StemSnapH", snap_widths, 12, num_snap_widths ) - T1_PRIVATE_NUM_TABLE ( "StemSnapV", snap_heights, 12, num_snap_heights ) + Z1_PRIVATE_NUM_TABLE ( "StemSnapH", snap_widths, 12, num_snap_widths ) + Z1_PRIVATE_NUM_TABLE ( "StemSnapV", snap_heights, 12, num_snap_heights ) #undef T1TYPE #define T1TYPE T1_Font - T1_TOPDICT_NUM( "PaintType", paint_type ) - T1_TOPDICT_NUM( "FontType", font_type ) - T1_TOPDICT_NUM( "StrokeWidth", stroke_width ) + Z1_TOPDICT_NUM( "PaintType", paint_type ) + Z1_TOPDICT_NUM( "FontType", font_type ) + Z1_TOPDICT_NUM( "StrokeWidth", stroke_width ) #if 0 /* define the font info dictionary parsing callbacks */