From 4ea7621019d58a67ae399c5401c41fc51762659a Mon Sep 17 00:00:00 2001 From: Werner Lemberg Date: Wed, 22 May 2002 04:53:25 +0000 Subject: [PATCH] * src/psaux/psobjs.c (T1Radix): New function. (t1_toint): Use it to handle numbers in radix format. * src/psaux/t1decode.c (T1_Decoder_Parse_Charstrings): Add dummy for undocumented, obsolete opcode 15. --- ChangeLog | 29 +++++++++++++++++----------- src/psaux/psobjs.c | 46 +++++++++++++++++++++++++++++++++++++++++++- src/psaux/t1decode.c | 4 ++++ 3 files changed, 67 insertions(+), 12 deletions(-) diff --git a/ChangeLog b/ChangeLog index d17c79ec7..5558a7b5a 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,18 +1,25 @@ +2002-05-21 Martin Muskens + + * src/psaux/psobjs.c (T1Radix): New function. + (t1_toint): Use it to handle numbers in radix format. + + * src/psaux/t1decode.c (T1_Decoder_Parse_Charstrings): Add dummy + for undocumented, obsolete opcode 15. + 2002-05-21 David Turner - * src/bdf/bdflic.c: removed compiler warning, and changed all tables - to the "static const" storage specifier (instead of simply 'static') + * src/bdf/bdflic.c: Removed compiler warning, and changed all tables + to the "static const" storage specifier (instead of simply + `static'). - * src/type42/t32drivr.c, src/bdf/bdfdrivr.c: - removing compiler warnings + * src/type42/t32drivr.c, src/bdf/bdfdrivr.c: Removing compiler + warnings. - * include/freetype/internal/ftbdf.h, src/base/ftbdf.c, - src/base/descrip.mms, src/base/Jamfile, src/base/rules.mk: - - Adding a new API called "FT_Get_BDF_Charset_ID" to retrieve - BDF-specific strings from a face. This is much cleaner - than accessing the internal types "BDF_Public_Face" defined in - FT_INTERNAL_BDF_TYPES_H + * include/freetype/internal/ftbdf.h, src/base/ftbdf.c, + src/base/descrip.mms, src/base/Jamfile, src/base/rules.mk + (FT_Get_BDF_Charset_ID): New API to retrieve BDF-specific strings + from a face. This is much cleaner than accessing the internal types + "BDF_Public_Face" defined in FT_INTERNAL_BDF_TYPES_H. 2002-05-21 Werner Lemberg diff --git a/src/psaux/psobjs.c b/src/psaux/psobjs.c index 891edb0b7..c24a0c724 100644 --- a/src/psaux/psobjs.c +++ b/src/psaux/psobjs.c @@ -434,13 +434,50 @@ } + static FT_Long + T1Radix( FT_Long radixBase, + FT_Byte** cur, + FT_Byte* limit ) + { + FT_Long result = 0; + FT_Byte radixEndChar0 = + (FT_Byte)( radixBase > 10 ? '9' + 1 : '0' + radixBase ); + FT_Byte radixEndChar1 = + (FT_Byte)( 'A' + radixBase - 10 ); + FT_Byte radixEndChar2 = + (FT_Byte)( 'a' + radixBase - 10 ); + + + while( *cur < limit ) + { + if ( (*cur)[0] >= '0' && (*cur)[0] < radixEndChar0 ) + result = result * radixBase + (*cur)[0] - '0'; + + else if ( radixBase > 10 && + (*cur)[0] >= 'A' && (*cur)[0] < radixEndChar1 ) + result = result * radixBase + ( (*cur)[0] - 'A' + 10 ); + + else if ( radixBase > 10 && + (*cur)[0] >= 'a' && (*cur)[0] < radixEndChar2 ) + result = result * radixBase + ( (*cur)[0] - 'a' + 10 ); + + else + return result; + + (*cur)++; + } + + return result; + } + + static FT_Long t1_toint( FT_Byte** cursor, FT_Byte* limit ) { FT_Long result = 0; FT_Byte* cur = *cursor; - FT_Byte c = '\0', d; + FT_Byte c = '\0', d; for ( ; cur < limit; cur++ ) @@ -463,7 +500,14 @@ { d = (FT_Byte)( cur[0] - '0' ); if ( d >= 10 ) + { + if ( cur[0] == '#' ) + { + cur++; + result = T1Radix( result, &cur, limit ); + } break; + } result = result * 10 + d; cur++; diff --git a/src/psaux/t1decode.c b/src/psaux/t1decode.c index b183fcb7c..4544ad1fb 100644 --- a/src/psaux/t1decode.c +++ b/src/psaux/t1decode.c @@ -432,6 +432,10 @@ op = op_endchar; break; + case 15: /* undocumented, obsolete operator */ + op = op_none; + break; + case 21: op = op_rmoveto; break;