* include/freetype/internal/psaux.h (T1_FieldType): Add T1_FIELD_TYPE_KEY. (T1_FIELD_KEY): New macro. * src/psaux/psobjs.c (ps_parser_load_field): Handle T1_FIELD_TYPE_KEY. * src/cid/cidtoken.h: Use T1_FIELD_KEY for /CIDFontName. * src/cache/ftlru.c (FT_LruList_Remove_Selection): Decrease number of nodes. (FT_LruList_Lookup): Fix assertion for out-of-memory case.
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/ChangeLog b/ChangeLog
index cbab9d4..3ebe8a6 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,19 @@
+2003-06-12 Werner Lemberg <wl@gnu.org>
+
+ * include/freetype/internal/psaux.h (T1_FieldType): Add
+ T1_FIELD_TYPE_KEY.
+ (T1_FIELD_KEY): New macro.
+ * src/psaux/psobjs.c (ps_parser_load_field): Handle
+ T1_FIELD_TYPE_KEY.
+
+ * src/cid/cidtoken.h: Use T1_FIELD_KEY for /CIDFontName.
+
+2003-06-11 Alexander Malmberg <alexander@malmberg.org>
+
+ * src/cache/ftlru.c (FT_LruList_Remove_Selection): Decrease
+ number of nodes.
+ (FT_LruList_Lookup): Fix assertion for out-of-memory case.
+
2003-06-11 Werner Lemberg <wl@gnu.org>
* src/cid/cidload.c (cid_decrypt): Removed.
diff --git a/include/freetype/internal/psaux.h b/include/freetype/internal/psaux.h
index d7f2c26..1e5b7f2 100644
--- a/include/freetype/internal/psaux.h
+++ b/include/freetype/internal/psaux.h
@@ -183,6 +183,7 @@ FT_BEGIN_HEADER
T1_FIELD_TYPE_FIXED_1000,
T1_FIELD_TYPE_FIXED_1000_P,
T1_FIELD_TYPE_STRING,
+ T1_FIELD_TYPE_KEY,
T1_FIELD_TYPE_BBOX,
T1_FIELD_TYPE_INTEGER_ARRAY,
T1_FIELD_TYPE_FIXED_ARRAY,
@@ -293,6 +294,9 @@ FT_BEGIN_HEADER
#define T1_FIELD_STRING( _ident, _fname ) \
T1_NEW_SIMPLE_FIELD( _ident, T1_FIELD_TYPE_STRING, _fname )
+#define T1_FIELD_KEY( _ident, _fname ) \
+ T1_NEW_SIMPLE_FIELD( _ident, T1_FIELD_TYPE_KEY, _fname )
+
#define T1_FIELD_BBOX( _ident, _fname ) \
T1_NEW_SIMPLE_FIELD( _ident, T1_FIELD_TYPE_BBOX, _fname )
diff --git a/src/cache/ftlru.c b/src/cache/ftlru.c
index eb2065a..95c1292 100644
--- a/src/cache/ftlru.c
+++ b/src/cache/ftlru.c
@@ -227,7 +227,7 @@
if ( node == NULL )
{
- FT_ASSERT( list->nodes == 0 );
+ FT_ASSERT( list->num_nodes == 0 );
error = FT_Err_Out_Of_Memory;
goto Exit;
}
@@ -245,7 +245,7 @@
* a classic destroy/create cycle.
*/
*pnode = NULL;
- list->num_nodes -= 1;
+ list->num_nodes--;
if ( clazz->node_flush )
{
@@ -379,6 +379,7 @@
clazz->node_done( node, list );
FT_FREE( node );
+ list->num_nodes--;
}
else
pnode = &(*pnode)->next;
diff --git a/src/cid/cidtoken.h b/src/cid/cidtoken.h
index eb38c7b..ff2a89d 100644
--- a/src/cid/cidtoken.h
+++ b/src/cid/cidtoken.h
@@ -21,7 +21,7 @@
#undef T1CODE
#define T1CODE T1_FIELD_LOCATION_CID_INFO
- T1_FIELD_STRING( "CIDFontName", cid_font_name )
+ T1_FIELD_KEY ( "CIDFontName", cid_font_name )
T1_FIELD_NUM ( "CIDFontVersion", cid_version )
T1_FIELD_NUM ( "CIDFontType", cid_font_type )
T1_FIELD_STRING( "Registry", registry )
diff --git a/src/psaux/psobjs.c b/src/psaux/psobjs.c
index fa1f74a..5ef111a 100644
--- a/src/psaux/psobjs.c
+++ b/src/psaux/psobjs.c
@@ -956,7 +956,7 @@
case 1:
{
FT_Memory memory = parser->memory;
- FT_Byte *p;
+ FT_Byte* p;
/* with synthetic fonts, it's possible to find a field twice */
@@ -973,8 +973,8 @@
case 2:
{
- FT_Memory memory = parser->memory;
- FT_UShort *p;
+ FT_Memory memory = parser->memory;
+ FT_UShort* p;
/* with synthetic fonts, it's possible to find a field twice */
@@ -991,8 +991,8 @@
case 4:
{
- FT_Memory memory = parser->memory;
- FT_UInt32 *p;
+ FT_Memory memory = parser->memory;
+ FT_UInt32* p;
/* with synthetic fonts, it's possible to find a field twice */
@@ -1010,7 +1010,7 @@
default:
{
FT_Memory memory = parser->memory;
- FT_Long *p;
+ FT_Long* p;
/* with synthetic fonts, it's possible to find a field twice */
@@ -1028,6 +1028,7 @@
break;
case T1_FIELD_TYPE_STRING:
+ case T1_FIELD_TYPE_KEY:
{
FT_Memory memory = parser->memory;
FT_UInt len = (FT_UInt)( limit - cur );
@@ -1037,6 +1038,12 @@
if ( *(FT_String**)q )
break;
+ if ( field->type == T1_FIELD_TYPE_KEY )
+ {
+ len--;
+ cur++;
+ }
+
if ( FT_ALLOC( string, len + 1 ) )
goto Exit;