@@ -226,45 +226,45 @@ protected void getDictItem() {
226
226
char b0 = getCard8 ();
227
227
if (b0 == 29 ) {
228
228
int item = getInt ();
229
- args [arg_count ] = Integer . valueOf ( item ) ;
229
+ args [arg_count ] = item ;
230
230
arg_count ++;
231
231
//System.err.println(item+" ");
232
232
continue ;
233
233
}
234
234
if (b0 == 28 ) {
235
235
short item = getShort ();
236
- args [arg_count ] = Integer . valueOf ( item ) ;
236
+ args [arg_count ] = ( int ) item ;
237
237
arg_count ++;
238
238
//System.err.println(item+" ");
239
239
continue ;
240
240
}
241
241
if (b0 >= 32 && b0 <= 246 ) {
242
242
byte item = (byte ) (b0 -139 );
243
- args [arg_count ] = Integer . valueOf ( item ) ;
243
+ args [arg_count ] = ( int ) item ;
244
244
arg_count ++;
245
245
//System.err.println(item+" ");
246
246
continue ;
247
247
}
248
248
if (b0 >= 247 && b0 <= 250 ) {
249
249
char b1 = getCard8 ();
250
250
short item = (short ) ((b0 -247 )*256 +b1 +108 );
251
- args [arg_count ] = Integer . valueOf ( item ) ;
251
+ args [arg_count ] = ( int ) item ;
252
252
arg_count ++;
253
253
//System.err.println(item+" ");
254
254
continue ;
255
255
}
256
256
if (b0 >= 251 && b0 <= 254 ) {
257
257
char b1 = getCard8 ();
258
258
short item = (short ) (-(b0 -251 )*256 -b1 -108 );
259
- args [arg_count ] = Integer . valueOf ( item ) ;
259
+ args [arg_count ] = ( int ) item ;
260
260
arg_count ++;
261
261
//System.err.println(item+" ");
262
262
continue ;
263
263
}
264
264
if (b0 == 30 ) {
265
265
StringBuilder item = new StringBuilder ("" );
266
266
boolean done = false ;
267
- char buffer = 0 ;
267
+ char buffer = ( char ) 0 ;
268
268
byte avail = 0 ;
269
269
int nibble = 0 ;
270
270
while (!done ) {
@@ -280,7 +280,7 @@ protected void getDictItem() {
280
280
case 0xf : done =true ; break ;
281
281
default :
282
282
if (nibble >= 0 && nibble <= 9 )
283
- item .append (String . valueOf ( nibble ) );
283
+ item .append (nibble );
284
284
else {
285
285
item .append ("<NIBBLE ERROR: " ).append (nibble ).append ('>' );
286
286
done = true ;
@@ -494,7 +494,7 @@ public void emit(byte[] buffer) {
494
494
495
495
static protected final class UInt16Item extends Item {
496
496
public char value ;
497
- public UInt16Item (char value ) {this .value = value ;}
497
+ public UInt16Item (char value ) {this .value = value ;}
498
498
499
499
@ Override
500
500
public void increment (int [] currentOffset ) {
@@ -504,8 +504,11 @@ public void increment(int[] currentOffset) {
504
504
// this is incomplete!
505
505
@ Override
506
506
public void emit (byte [] buffer ) {
507
- buffer [myOffset +0 ] = (byte ) (value >>> 8 & 0xff );
508
- buffer [myOffset +1 ] = (byte ) (value >>> 0 & 0xff );
507
+ // Simplify from: there is no sense in >>> for unsigned char.
508
+ // buffer[myOffset+0] = (byte) (value >>> 8 & 0xff);
509
+ // buffer[myOffset+1] = (byte) (value >>> 0 & 0xff);
510
+ buffer [myOffset +0 ] = (byte ) (value >> 8 & 0xff );
511
+ buffer [myOffset +1 ] = (byte ) (value >> 0 & 0xff );
509
512
}
510
513
}
511
514
@@ -524,7 +527,8 @@ public void increment(int[] currentOffset) {
524
527
// this is incomplete!
525
528
@ Override
526
529
public void emit (byte [] buffer ) {
527
- buffer [myOffset +0 ] = (byte ) (value >>> 0 & 0xff );
530
+ //buffer[myOffset+0] = (byte) (value >>> 0 & 0xff);
531
+ buffer [myOffset +0 ] = (byte ) (value & 0xff );
528
532
}
529
533
}
530
534
@@ -718,16 +722,16 @@ public byte[] getCID(String fontName)
718
722
int p1 = getPosition ();
719
723
getDictItem ();
720
724
int p2 = getPosition ();
721
- if (key == "Encoding"
722
- || key == "Private"
723
- || key == "FDSelect"
724
- || key == "FDArray"
725
- || key == "charset"
726
- || key == "CharStrings"
725
+ if ("Encoding" . equals ( key )
726
+ || "Private" . equals ( key )
727
+ || "FDSelect" . equals ( key )
728
+ || "FDArray" . equals ( key )
729
+ || "charset" . equals ( key )
730
+ || "CharStrings" . equals ( key )
727
731
) {
728
732
// just drop them
729
733
} else {
730
- l .add (new RangeItem (buf ,p1 ,p2 -p1 ));
734
+ l .addLast (new RangeItem (buf ,p1 ,p2 -p1 ));
731
735
}
732
736
}
733
737
0 commit comments