* 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.
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
diff --git a/ChangeLog b/ChangeLog
index d17c79e..5558a7b 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,18 +1,25 @@
+2002-05-21 Martin Muskens <mmuskens@aurelon.com>
+
+ * 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 <david@freetype.org>
- * 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 <wl@gnu.org>
diff --git a/src/psaux/psobjs.c b/src/psaux/psobjs.c
index 891edb0..c24a0c7 100644
--- a/src/psaux/psobjs.c
+++ b/src/psaux/psobjs.c
@@ -435,12 +435,49 @@
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 b183fcb..4544ad1 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;