diff --git a/CHANGES b/CHANGES index 249665e7a..4013727a6 100644 --- a/CHANGES +++ b/CHANGES @@ -1,5 +1,8 @@ LATEST_CHANGES + - a minor fix to the Type 1 driver to let them apply the font matrix + correctly (used for many oblique fonts..) + - some fixes for 64-bit systems (mainly changing some FT_TRACE calls to use %p instead of %lx).. Thanks to Karl Robillard diff --git a/src/type1/t1gload.c b/src/type1/t1gload.c index 585204d4e..921ecc536 100644 --- a/src/type1/t1gload.c +++ b/src/type1/t1gload.c @@ -1565,6 +1565,9 @@ FT_BBox cbox; FT_Glyph_Metrics* metrics = &glyph->root.metrics; + /* apply the font matrix */ + FT_Outline_Transform( &glyph->root.outline, &face->type1.font_matrix ); + FT_Outline_Get_CBox( &glyph->root.outline, &cbox ); /* grid fit the bounding box if necessary */ diff --git a/src/type1/t1parse.c b/src/type1/t1parse.c index 9a71f9990..6f4ae78d1 100644 --- a/src/type1/t1parse.c +++ b/src/type1/t1parse.c @@ -586,8 +586,8 @@ switch (n) { case 0 : result = &matrix->xx; break; - case 1 : result = &matrix->xy; break; - case 2 : result = &matrix->yx; break; + case 1 : result = &matrix->yx; break; + case 2 : result = &matrix->xy; break; default: result = &matrix->yy; } diff --git a/src/type1z/t1gload.c b/src/type1z/t1gload.c index 71a717326..9fbb56f7d 100644 --- a/src/type1z/t1gload.c +++ b/src/type1z/t1gload.c @@ -1349,6 +1349,9 @@ metrics->vertAdvance = FT_MulFix( metrics->vertAdvance, x_scale ); } + /* apply the font matrix */ + FT_Outline_Transform( &glyph->root.outline, &face->type1.font_matrix ); + /* compute the other metrics */ FT_Outline_Get_CBox( &glyph->root.outline, &cbox ); diff --git a/src/type1z/t1parse.c b/src/type1z/t1parse.c index b7d9506f9..3ce808640 100644 --- a/src/type1z/t1parse.c +++ b/src/type1z/t1parse.c @@ -579,6 +579,43 @@ return t1_tobool( &parser->cursor, parser->limit ); } + +#if 0 + /* load a single field in an object */ + LOCAL_FUNC + T1_Error T1_Load_Field( T1_Parser* parser, + void* object, + T1_Field_Rec* field ) + { + FT_Byte* p = (FT_Byte*)object + field->offset; + FT_Byte** pcursor = &parser->cursor; + FT_Byte* limit = parser->limit; + + switch (field->type) + { + case t1_field_boolean: + *(T1_Bool*)p = t1_tobool( pcursor, limit ); + break; + + case t1_field_string: + *(T1_String**)p = t1_tostring( pcursor, limit, parser->memory ); + break; + + case t1_field_int: + *(T1_Long*)p = t1_toint( pcursor, limit ); + break; + + case t1_field_fixed: + *(T1_Fixed*)p = t1_tofixed( pcursor, limit, field->power_ten ); + break; + + default: + return T1_Err_Invalid_Argument; + } + return 0; + } +#endif + static FT_Error read_pfb_tag( FT_Stream stream, T1_UShort *tag, T1_Long* size ) { diff --git a/src/type1z/t1parse.h b/src/type1z/t1parse.h index 6482d52e1..0dd7a897a 100644 --- a/src/type1z/t1parse.h +++ b/src/type1z/t1parse.h @@ -37,6 +37,30 @@ extern "C" { #endif + + typedef enum T1_Field_Type_ + { + t1_field_none = 0, + t1_field_bool, + t1_field_integer, + t1_field_fixed, + t1_field_string, + t1_field_fixed_array, + t1_field_coord_array + + } T1_Field_Type; + + + typedef struct T1_Field_Rec_ + { + T1_Field_Type type; /* type of field */ + FT_UInt offset; /* offset of field in object */ + FT_UInt size; /* size of field in bytes */ + T1_Int array_max; /* maximum number of elements for array */ + T1_Int power_ten; /* power of ten for "fixed" fields */ + + } T1_Field_Rec; + /************************************************************************* * * T1_Table @@ -183,6 +207,14 @@ T1_Int T1_ToImmediate( T1_Parser* parser ); #endif +#if 0 + /* load a single field in an object */ + LOCAL_DEF + T1_Error T1_Load_Field( T1_Parser* parser, + void* object, + T1_Field_Rec* field ); +#endif + LOCAL_DEF T1_Error T1_New_Parser( T1_Parser* parser, FT_Stream stream,