Martin Muskens bufixes: - reallocation bug in T1_Table_Add - increased accuracy of units per EM computation in T1 fonts - support "+" as valid font name character (used in embedded fonts)
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
diff --git a/ChangeLog b/ChangeLog
index 1ddab13..95937c8 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,15 @@
+2001-08-30 Martin Muskens <mmuskens@aurelon.com>
+
+ * src/type1/t1load.c (parse_font_matrix): a new way to compute the
+ units per EM with greater accuracy (important for embedded T1 fonts in
+ PDF documents that were automatically generated from TrueType ones).
+
+ * src/type1/t1load.c (is_alpha): now supports "+" in font names, this
+ is used in embedded fonts..
+
+ * src/psaux/psobjs.c (PS_Table_Add): fixed a reallocation bug that
+ generated a dangling pointer reference.
+
2001-08-30 Anthony Feik <afeick@hotmail.com>
* src/type1/t1afm.c (T1_Read_Afm): now correctly sets the flag
diff --git a/src/psaux/psobjs.c b/src/psaux/psobjs.c
index e38c104..92e5b0e 100644
--- a/src/psaux/psobjs.c
+++ b/src/psaux/psobjs.c
@@ -164,8 +164,12 @@
if ( table->cursor + length > table->capacity )
{
FT_Error error;
- FT_Offset new_size = table->capacity;
-
+ FT_Offset new_size = table->capacity;
+ FT_Long in_offset;
+
+ in_offset = (FT_Long)((FT_Byte*)object - table->block);
+ if ( (FT_ULong)in_offset >= table->capacity )
+ in_offset = -1;
while ( new_size < table->cursor + length )
new_size += 1024;
@@ -173,6 +177,9 @@
error = reallocate_t1_table( table, new_size );
if ( error )
return error;
+
+ if ( in_offset >= 0 )
+ object = table->block + in_offset;
}
/* add the object to the base block and adjust offset */
diff --git a/src/type1/t1load.c b/src/type1/t1load.c
index ce1b23b..b4a9a9a 100644
--- a/src/type1/t1load.c
+++ b/src/type1/t1load.c
@@ -766,7 +766,10 @@
static int
is_alpha( FT_Byte c )
{
- return ( isalnum( c ) || c == '.' || c == '_' || c == '-' );
+ /* Note: we must accept "+" as a valid character, as it is used in */
+ /* embedded type1 fonts in PDF documents.. */
+ /* */
+ return ( isalnum( c ) || c == '.' || c == '_' || c == '-' || c == '+' );
}
@@ -895,8 +898,9 @@
/* 1000 / temp_scale, because temp_scale was already multiplied by */
/* 1000 (in t1_tofixed, from psobjs.c). */
- root->units_per_EM = (FT_UShort)FT_DivFix( 0x10000L,
- FT_DivFix( temp_scale, 1000 ) );
+ root->units_per_EM = (FT_UShort)(FT_DivFix( 1000*0x10000L,
+ temp_scale ) >> 16);
+
/* we need to scale the values by 1.0/temp_scale */
if ( temp_scale != 0x10000L )