From 27a4f9c4ac45ff65f941964f7351b64b1e6a9f35 Mon Sep 17 00:00:00 2001 From: scuri Date: Tue, 20 Oct 2009 17:20:18 +0000 Subject: *** empty log message *** --- src/freetype2/type1/t1afm.c | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) (limited to 'src/freetype2/type1/t1afm.c') diff --git a/src/freetype2/type1/t1afm.c b/src/freetype2/type1/t1afm.c index b81a8df..16dc471 100644 --- a/src/freetype2/type1/t1afm.c +++ b/src/freetype2/type1/t1afm.c @@ -4,7 +4,7 @@ /* */ /* AFM support for Type 1 fonts (body). */ /* */ -/* Copyright 1996-2001, 2002, 2003, 2004, 2005, 2006, 2007 by */ +/* Copyright 1996-2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008 by */ /* David Turner, Robert Wilhelm, and Werner Lemberg. */ /* */ /* This file is part of the FreeType project, and may only be used, */ @@ -50,13 +50,17 @@ /* read a glyph name and return the equivalent glyph index */ static FT_Int t1_get_index( const char* name, - FT_UInt len, + FT_Offset len, void* user_data ) { T1_Font type1 = (T1_Font)user_data; FT_Int n; + /* PS string/name length must be < 16-bit */ + if ( ( len - 0xFFFFU ) > 0 ) + return 0; + for ( n = 0; n < type1->num_glyphs; n++ ) { char* gname = (char*)type1->glyph_names[n]; @@ -88,7 +92,12 @@ FT_ULong index2 = KERN_INDEX( pair2->index1, pair2->index2 ); - return (int)( index1 - index2 ); + if ( index1 > index2 ) + return 1; + else if ( index1 < index2 ) + return -1; + else + return 0; } -- cgit v1.2.3