* 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.
This commit is contained in:
Werner Lemberg 2003-06-12 13:14:15 +00:00
parent 75aae7db17
commit 88c0478dce
5 changed files with 37 additions and 9 deletions

View File

@ -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> 2003-06-11 Werner Lemberg <wl@gnu.org>
* src/cid/cidload.c (cid_decrypt): Removed. * src/cid/cidload.c (cid_decrypt): Removed.

View File

@ -183,6 +183,7 @@ FT_BEGIN_HEADER
T1_FIELD_TYPE_FIXED_1000, T1_FIELD_TYPE_FIXED_1000,
T1_FIELD_TYPE_FIXED_1000_P, T1_FIELD_TYPE_FIXED_1000_P,
T1_FIELD_TYPE_STRING, T1_FIELD_TYPE_STRING,
T1_FIELD_TYPE_KEY,
T1_FIELD_TYPE_BBOX, T1_FIELD_TYPE_BBOX,
T1_FIELD_TYPE_INTEGER_ARRAY, T1_FIELD_TYPE_INTEGER_ARRAY,
T1_FIELD_TYPE_FIXED_ARRAY, T1_FIELD_TYPE_FIXED_ARRAY,
@ -293,6 +294,9 @@ FT_BEGIN_HEADER
#define T1_FIELD_STRING( _ident, _fname ) \ #define T1_FIELD_STRING( _ident, _fname ) \
T1_NEW_SIMPLE_FIELD( _ident, T1_FIELD_TYPE_STRING, _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 ) \ #define T1_FIELD_BBOX( _ident, _fname ) \
T1_NEW_SIMPLE_FIELD( _ident, T1_FIELD_TYPE_BBOX, _fname ) T1_NEW_SIMPLE_FIELD( _ident, T1_FIELD_TYPE_BBOX, _fname )

5
src/cache/ftlru.c vendored
View File

@ -227,7 +227,7 @@
if ( node == NULL ) if ( node == NULL )
{ {
FT_ASSERT( list->nodes == 0 ); FT_ASSERT( list->num_nodes == 0 );
error = FT_Err_Out_Of_Memory; error = FT_Err_Out_Of_Memory;
goto Exit; goto Exit;
} }
@ -245,7 +245,7 @@
* a classic destroy/create cycle. * a classic destroy/create cycle.
*/ */
*pnode = NULL; *pnode = NULL;
list->num_nodes -= 1; list->num_nodes--;
if ( clazz->node_flush ) if ( clazz->node_flush )
{ {
@ -379,6 +379,7 @@
clazz->node_done( node, list ); clazz->node_done( node, list );
FT_FREE( node ); FT_FREE( node );
list->num_nodes--;
} }
else else
pnode = &(*pnode)->next; pnode = &(*pnode)->next;

View File

@ -21,7 +21,7 @@
#undef T1CODE #undef T1CODE
#define T1CODE T1_FIELD_LOCATION_CID_INFO #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 ( "CIDFontVersion", cid_version )
T1_FIELD_NUM ( "CIDFontType", cid_font_type ) T1_FIELD_NUM ( "CIDFontType", cid_font_type )
T1_FIELD_STRING( "Registry", registry ) T1_FIELD_STRING( "Registry", registry )

View File

@ -956,7 +956,7 @@
case 1: case 1:
{ {
FT_Memory memory = parser->memory; FT_Memory memory = parser->memory;
FT_Byte *p; FT_Byte* p;
/* with synthetic fonts, it's possible to find a field twice */ /* with synthetic fonts, it's possible to find a field twice */
@ -973,8 +973,8 @@
case 2: case 2:
{ {
FT_Memory memory = parser->memory; FT_Memory memory = parser->memory;
FT_UShort *p; FT_UShort* p;
/* with synthetic fonts, it's possible to find a field twice */ /* with synthetic fonts, it's possible to find a field twice */
@ -991,8 +991,8 @@
case 4: case 4:
{ {
FT_Memory memory = parser->memory; FT_Memory memory = parser->memory;
FT_UInt32 *p; FT_UInt32* p;
/* with synthetic fonts, it's possible to find a field twice */ /* with synthetic fonts, it's possible to find a field twice */
@ -1010,7 +1010,7 @@
default: default:
{ {
FT_Memory memory = parser->memory; FT_Memory memory = parser->memory;
FT_Long *p; FT_Long* p;
/* with synthetic fonts, it's possible to find a field twice */ /* with synthetic fonts, it's possible to find a field twice */
@ -1028,6 +1028,7 @@
break; break;
case T1_FIELD_TYPE_STRING: case T1_FIELD_TYPE_STRING:
case T1_FIELD_TYPE_KEY:
{ {
FT_Memory memory = parser->memory; FT_Memory memory = parser->memory;
FT_UInt len = (FT_UInt)( limit - cur ); FT_UInt len = (FT_UInt)( limit - cur );
@ -1037,6 +1038,12 @@
if ( *(FT_String**)q ) if ( *(FT_String**)q )
break; break;
if ( field->type == T1_FIELD_TYPE_KEY )
{
len--;
cur++;
}
if ( FT_ALLOC( string, len + 1 ) ) if ( FT_ALLOC( string, len + 1 ) )
goto Exit; goto Exit;