minor fix to the Type1 driver(s) to apply the font matrix when necessary..
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154
diff --git a/CHANGES b/CHANGES
index 249665e..4013727 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 585204d..921ecc5 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 9a71f99..6f4ae78 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 71a7173..9fbb56f 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 b7d9506..3ce8086 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 6482d52..0dd7a89 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;
+
/*************************************************************************
*
* <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,