minor fix to the Type1 driver(s) to apply the font matrix when

necessary..
This commit is contained in:
David Turner 2000-05-23 22:16:27 +00:00
parent 5e4c2cb3bf
commit f5dcdd5cfb
6 changed files with 80 additions and 2 deletions

View File

@ -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

View File

@ -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 */

View File

@ -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;
}

View File

@ -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 );

View File

@ -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 )
{

View File

@ -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;
/*************************************************************************
*
* <Struct> 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,