Commit 1c0d4acb256927c69bcfadc47c98458754e20865

Werner Lemberg 2000-06-06T20:41:48

Fine-tuned a lot of tracing levels to make them more functional with ftview. Added a lot of \n to tracing messages. Fixed a serious bug in loading SBit offsets (missing parentheses around a xxx ? yyy : zzz construct). Replaced most GET_xxx() functions with calls to READ_Frame() in ttsbit.c

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
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
diff --git a/src/base/ftextend.c b/src/base/ftextend.c
index 7269871..252934d 100644
--- a/src/base/ftextend.c
+++ b/src/base/ftextend.c
@@ -77,7 +77,7 @@
     registry->cur_offset     = 0;
     driver->extensions       = registry;
 
-    FT_TRACE2(( "FT_Init_Extensions: success" ));
+    FT_TRACE2(( "FT_Init_Extensions: success\n" ));
 
     return FT_Err_Ok;
   }
@@ -153,7 +153,7 @@
       registry->num_extensions++;
       registry->cur_offset += ( cur->size + FT_ALIGNMENT-1 ) & -FT_ALIGNMENT;
 
-      FT_TRACE1(( "FT_Register_Extension: `%s' successfully registered",
+      FT_TRACE1(( "FT_Register_Extension: `%s' successfully registered\n",
                   cur->id ));
     }
 
@@ -204,7 +204,7 @@
         {
           *extension_interface = cur->interface;
 
-          FT_TRACE1(( "FT_Get_Extension: got `%s'", extension_id ));
+          FT_TRACE1(( "FT_Get_Extension: got `%s'\n", extension_id ));
 
           return (void*)((char*)face->extensions + cur->offset);
         }
@@ -212,7 +212,7 @@
 
     /* could not find the extension id */
 
-    FT_ERROR(( "FT_Get_Extension: couldn't find `%s'", extension_id ));
+    FT_ERROR(( "FT_Get_Extension: couldn't find `%s'\n", extension_id ));
 
     *extension_interface = 0;
 
diff --git a/src/base/ftinit.c b/src/base/ftinit.c
index 3d524ac..8b5dabe 100644
--- a/src/base/ftinit.c
+++ b/src/base/ftinit.c
@@ -130,7 +130,7 @@ const FT_DriverInterface*  ft_default_drivers[] =
     if ( !memory )
     {
       FT_ERROR(( "FT_Init_FreeType:" ));
-      FT_ERROR(( " cannot find memory manager" ));
+      FT_ERROR(( " cannot find memory manager\n" ));
       return FT_Err_Unimplemented_Feature;
     }
 
diff --git a/src/base/ftraster.c b/src/base/ftraster.c
index c450d0b..40ee193 100644
--- a/src/base/ftraster.c
+++ b/src/base/ftraster.c
@@ -565,7 +565,7 @@
       break;
 
     default:
-      FT_ERROR(( "Invalid profile direction in Raster:New_Profile !!\n" ));
+      FT_ERROR(( "New_Profile: invalid profile direction!\n" ));
       ras.error = Raster_Err_Invalid;
       return FAILURE;
     }
@@ -609,7 +609,7 @@
 
     if ( h < 0 )
     {
-      FT_ERROR(( "Negative height encountered in End_Profile!\n" ));
+      FT_ERROR(( "End_Profile: negative height encountered!\n" ));
       ras.error = Raster_Err_Neg_Height;
       return FAILURE;
     }
diff --git a/src/base/ftstream.c b/src/base/ftstream.c
index 286cc5f..d43eb01 100644
--- a/src/base/ftstream.c
+++ b/src/base/ftstream.c
@@ -138,7 +138,7 @@
     if ( read_bytes < count )
     {
       FT_ERROR(( "FT_Read_Stream_At:" ));
-      FT_ERROR(( " invalid read; expected %lu bytes, got %lu",
+      FT_ERROR(( " invalid read; expected %lu bytes, got %lu\n",
                  count, read_bytes ));
 
       error = FT_Err_Invalid_Stream_Operation;
@@ -208,7 +208,7 @@
       if ( read_bytes < count )
       {
         FT_ERROR(( "FT_Access_Frame:" ));
-        FT_ERROR(( " invalid read; expected %lu bytes, got %lu",
+        FT_ERROR(( " invalid read; expected %lu bytes, got %lu\n",
                    count, read_bytes ));
 
         FREE( stream->base );
@@ -225,7 +225,7 @@
            stream->pos + count > stream->size )
       {
         FT_ERROR(( "FT_Access_Frame:" ));
-        FT_ERROR(( " invalid i/o; pos = 0x%lx, count = %lu, size = 0x%lx",
+        FT_ERROR(( " invalid i/o; pos = 0x%lx, count = %lu, size = 0x%lx\n",
                    stream->pos, count, stream->size ));
 
         error = FT_Err_Invalid_Stream_Operation;
@@ -364,7 +364,7 @@
   Fail:
     *error = FT_Err_Invalid_Stream_Operation;
     FT_ERROR(( "FT_Read_Char:" ));
-    FT_ERROR(( " invalid i/o; pos = 0x%lx, size = 0x%lx",
+    FT_ERROR(( " invalid i/o; pos = 0x%lx, size = 0x%lx\n",
                stream->pos, stream->size ));
 
     return 0;
@@ -410,7 +410,7 @@
   Fail:
     *error = FT_Err_Invalid_Stream_Operation;
     FT_ERROR(( "FT_Read_Short:" ));
-    FT_ERROR(( " invalid i/o; pos = 0x%lx, size = 0x%lx",
+    FT_ERROR(( " invalid i/o; pos = 0x%lx, size = 0x%lx\n",
                stream->pos, stream->size ));
 
     return 0;
@@ -456,7 +456,7 @@
   Fail:
     *error = FT_Err_Invalid_Stream_Operation;
     FT_ERROR(( "FT_Read_Offset:" ));
-    FT_ERROR(( " invalid i/o; pos = 0x%lx, size = 0x%lx",
+    FT_ERROR(( " invalid i/o; pos = 0x%lx, size = 0x%lx\n",
                stream->pos, stream->size ));
 
     return 0;
@@ -501,7 +501,7 @@
 
   Fail:
     FT_ERROR(( "FT_Read_Long:" ));
-    FT_ERROR(( " invalid i/o; pos = 0x%lx, size = 0x%lx",
+    FT_ERROR(( " invalid i/o; pos = 0x%lx, size = 0x%lx\n",
                stream->pos, stream->size ));
     *error = FT_Err_Invalid_Stream_Operation;
 
diff --git a/src/cff/t2objs.c b/src/cff/t2objs.c
index f87d0dd..61cc856 100644
--- a/src/cff/t2objs.c
+++ b/src/cff/t2objs.c
@@ -85,7 +85,7 @@
     /* We must also be able to accept Mac/GX fonts, as well as OT ones */
     if ( face->format_tag != 0x4f54544f )     /* OpenType/CFF font */
     {
-      FT_TRACE2(( "[not a valid OpenType/CFF font]" ));
+      FT_TRACE2(( "[not a valid OpenType/CFF font]\n" ));
       goto Bad_Format;
     }
 
diff --git a/src/cid/cidparse.c b/src/cid/cidparse.c
index c400b7b..1894d15 100644
--- a/src/cid/cidparse.c
+++ b/src/cid/cidparse.c
@@ -868,7 +868,7 @@
 
     if ( strncmp( stream->cursor, "%!PS-Adobe-3.0 Resource-CIDFont", 31 ) )
     {
-      FT_ERROR(( "Not a valid CID-keyed font\n" ));
+      FT_ERROR(( "[not a valid CID-keyed font]\n" ));
       error = FT_Err_Unknown_File_Format;
     }
 
diff --git a/src/sfnt/ttload.c b/src/sfnt/ttload.c
index 4355bed..8a8fc84 100644
--- a/src/sfnt/ttload.c
+++ b/src/sfnt/ttload.c
@@ -58,7 +58,7 @@
     TT_Table*  limit;
 
 
-    FT_TRACE3(( "TT_LookUp_Table: %08p, `%c%c%c%c' )\n",
+    FT_TRACE3(( "TT_LookUp_Table: %08p, `%c%c%c%c'\n",
                   face,
                   (TT_Char)( tag >> 24 ),
                   (TT_Char)( tag >> 16 ),
diff --git a/src/sfnt/ttpost.h b/src/sfnt/ttpost.h
index 4c385d4..ceb7c59 100644
--- a/src/sfnt/ttpost.h
+++ b/src/sfnt/ttpost.h
@@ -31,19 +31,12 @@ extern "C" {
 #define TT_Err_Invalid_Post_Table_Format  0x0B00
 #define TT_Err_Invalid_Post_Table         0x0B01
 
-#if 0
-  /* the 258 standard Mac glyph names, used for format 1.0 and 2.5 */
-  LOCAL_DEF
-  const TT_String*  TT_Mac_Postscript_Names[];
-#endif
-
 
   LOCAL_DEF
   TT_Error TT_Get_PS_Name( TT_Face      face,
                            TT_UInt      index,
                            TT_String**  PSname );
 
-
   LOCAL_DEF
   void  TT_Free_Post_Names( TT_Face  face );
 
diff --git a/src/sfnt/ttsbit.c b/src/sfnt/ttsbit.c
index 79e5f8a..07c165f 100644
--- a/src/sfnt/ttsbit.c
+++ b/src/sfnt/ttsbit.c
@@ -170,96 +170,21 @@
   }
 
 
-  /*************************************************************************/
-  /*                                                                       */
-  /* <Function>                                                            */
-  /*    TT_Load_Small_SBit_Metrics                                         */
-  /*                                                                       */
-  /* <Description>                                                         */
-  /*    Loads a small bitmap metrics record.                               */
-  /*                                                                       */
-  /* <Input>                                                               */
-  /*    stream  :: The input stream.                                       */
-  /*                                                                       */
-  /* <Output>                                                              */
-  /*    metrics :: A small metrics structure.                              */
-  /*                                                                       */
-  static
-  void  TT_Load_Small_SBit_Metrics( TT_SBit_Small_Metrics*  metrics,
-                                    FT_Stream               stream )
-  {
-    metrics->height   = GET_Byte();
-    metrics->width    = GET_Byte();
-    metrics->bearingX = GET_Char();
-    metrics->bearingY = GET_Char();
-    metrics->advance  = GET_Byte();
-  }
-
-
-  /*************************************************************************/
-  /*                                                                       */
-  /* <Function>                                                            */
-  /*    TT_Load_SBit_Metrics                                               */
-  /*                                                                       */
-  /* <Description>                                                         */
-  /*    Loads a bitmap metrics record.                                     */
-  /*                                                                       */
-  /* <Input>                                                               */
-  /*    stream  :: The input stream.                                       */
-  /*                                                                       */
-  /* <Output>                                                              */
-  /*    metrics :: A metrics structure.                                    */
-  /*                                                                       */
-  static
-  void  TT_Load_SBit_Metrics( TT_SBit_Metrics*  metrics,
-                              FT_Stream         stream )
+  const FT_Frame_Field  sbit_metrics_fields[] =
   {
-    metrics->height       = GET_Byte();
-    metrics->width        = GET_Byte();
+    FT_FRAME_START( 8 ),
+      FT_FRAME_BYTE( TT_SBit_Metrics, height ),
+      FT_FRAME_BYTE( TT_SBit_Metrics, width ),
 
-    metrics->horiBearingX = GET_Char();
-    metrics->horiBearingY = GET_Char();
-    metrics->horiAdvance  = GET_Byte();
+      FT_FRAME_CHAR( TT_SBit_Metrics, horiBearingX ),
+      FT_FRAME_CHAR( TT_SBit_Metrics, horiBearingY ),
+      FT_FRAME_BYTE( TT_SBit_Metrics, horiAdvance ),
 
-    metrics->vertBearingX = GET_Char();
-    metrics->vertBearingY = GET_Char();
-    metrics->vertAdvance  = GET_Byte();
-  }
-
-
-  /*************************************************************************/
-  /*                                                                       */
-  /* <Function>                                                            */
-  /*    TT_Load_SBit_Line_Metrics                                          */
-  /*                                                                       */
-  /* <Description>                                                         */
-  /*    Loads a bitmap line metrics record.                                */
-  /*                                                                       */
-  /* <Input>                                                               */
-  /*    stream  :: The input stream.                                       */
-  /*                                                                       */
-  /* <Output>                                                              */
-  /*    metrics :: A line metrics structure.                               */
-  /*                                                                       */
-  static
-  void  TT_Load_SBit_Line_Metrics( TT_SBit_Line_Metrics*  metrics,
-                                   FT_Stream              stream )
-  {
-    metrics->ascender  = GET_Char();
-    metrics->descender = GET_Char();
-    metrics->max_width = GET_Byte();
-
-    metrics->caret_slope_numerator   = GET_Char();
-    metrics->caret_slope_denominator = GET_Char();
-    metrics->caret_offset            = GET_Char();
-
-    metrics->min_origin_SB  = GET_Char();
-    metrics->min_advance_SB = GET_Char();
-    metrics->max_before_BL  = GET_Char();
-    metrics->min_after_BL   = GET_Char();
-    metrics->pads[0]        = GET_Char();
-    metrics->pads[1]        = GET_Char();
-  }
+      FT_FRAME_CHAR( TT_SBit_Metrics, vertBearingX ),
+      FT_FRAME_CHAR( TT_SBit_Metrics, vertBearingY ),
+      FT_FRAME_BYTE( TT_SBit_Metrics, vertAdvance ),
+    FT_FRAME_END
+  };
 
 
   /*************************************************************************/
@@ -285,15 +210,10 @@
     TT_Error  error;
 
 
-    if ( !ACCESS_Frame( 12L ) )
-    {
-      range->image_size = GET_ULong();
-      TT_Load_SBit_Metrics( &range->metrics, stream );
-
-      FORGET_Frame();
-    }
+    if ( READ_ULong( range->image_size ) )
+      return error;
 
-    return error;
+    return READ_Fields( sbit_metrics_fields, &range->metrics );
   }
 
 
@@ -400,7 +320,7 @@
         range->num_glyphs = num_glyphs;
         num_glyphs++;                       /* XXX: BEWARE - see spec */
 
-        size_elem  = large ? 4 : 2;
+        size_elem = large ? 4 : 2;
 
         if ( ALLOC_ARRAY( range->glyph_offsets,
                           num_glyphs, TT_ULong )    ||
@@ -409,7 +329,8 @@
 
         for ( n = 0; n < num_glyphs; n++ )
           range->glyph_offsets[n] = (TT_ULong)( range->image_offset +
-                                     large ? GET_ULong() : GET_UShort() );
+                                                  ( large ? GET_ULong()
+                                                          : GET_UShort() ) );
         FORGET_Frame();
       }
       break;
@@ -462,6 +383,26 @@
     TT_ULong   num_strikes;
     TT_ULong   table_base;
 
+    const FT_Frame_Field  sbit_line_metrics_fields[] =
+    {
+      /* no FT_FRAME_START */
+        FT_FRAME_CHAR( TT_SBit_Line_Metrics, ascender ),
+        FT_FRAME_CHAR( TT_SBit_Line_Metrics, descender ),
+        FT_FRAME_BYTE( TT_SBit_Line_Metrics, max_width ),
+
+        FT_FRAME_CHAR( TT_SBit_Line_Metrics, caret_slope_numerator ),
+        FT_FRAME_CHAR( TT_SBit_Line_Metrics, caret_slope_denominator ),
+        FT_FRAME_CHAR( TT_SBit_Line_Metrics, caret_offset ),
+
+        FT_FRAME_CHAR( TT_SBit_Line_Metrics, min_origin_SB ),
+        FT_FRAME_CHAR( TT_SBit_Line_Metrics, min_advance_SB ),
+        FT_FRAME_CHAR( TT_SBit_Line_Metrics, max_before_BL ),
+        FT_FRAME_CHAR( TT_SBit_Line_Metrics, min_after_BL ),
+        FT_FRAME_CHAR( TT_SBit_Line_Metrics, pads[0] ),
+        FT_FRAME_CHAR( TT_SBit_Line_Metrics, pads[1] ),
+      FT_FRAME_END
+    };
+
 
     face->num_sbit_strikes = 0;
 
@@ -483,8 +424,8 @@
     FORGET_Frame();
 
     /* check version number and strike count */
-    if ( version     != 0x00020000 ||
-         num_strikes >= 0x10000    )
+    if ( version     != 0x00020000L ||
+         num_strikes >= 0x10000L    )
     {
       FT_ERROR(( "TT_Load_SBit_Strikes: invalid table version!\n" ));
       error = TT_Err_Invalid_File_Format;
@@ -512,21 +453,21 @@
         TT_ULong  indexTablesSize;
 
 
-        strike->ranges_offset    = GET_ULong();
-        indexTablesSize          = GET_ULong();  /* don't save */
+        strike->ranges_offset = GET_ULong();
+        indexTablesSize       = GET_ULong();  /* don't save */
 
-        strike->num_ranges       = GET_ULong();
-        strike->color_ref        = GET_ULong();
+        strike->num_ranges    = GET_ULong();
+        strike->color_ref     = GET_ULong();
 
-        TT_Load_SBit_Line_Metrics( &strike->hori, stream );
-        TT_Load_SBit_Line_Metrics( &strike->vert, stream );
+        (void)READ_Fields( sbit_line_metrics_fields, &strike->hori );
+        (void)READ_Fields( sbit_line_metrics_fields, &strike->vert );
 
-        strike->start_glyph      = GET_UShort();
-        strike->end_glyph        = GET_UShort();
-        strike->x_ppem           = GET_Byte();
-        strike->y_ppem           = GET_Byte();
-        strike->bit_depth        = GET_Byte();
-        strike->flags            = GET_Char();
+        strike->start_glyph   = GET_UShort();
+        strike->end_glyph     = GET_UShort();
+        strike->x_ppem        = GET_Byte();
+        strike->y_ppem        = GET_Byte();
+        strike->bit_depth     = GET_Byte();
+        strike->flags         = GET_Char();
 
         count--;
         strike++;
@@ -799,7 +740,8 @@
         TT_Error  error;
 
 
-        error = Find_SBit_Range( glyph_index, strike, arange, aglyph_offset );
+        error = Find_SBit_Range( glyph_index, strike,
+                                 arange, aglyph_offset );
         if ( error )
           goto Fail;
 
@@ -859,16 +801,25 @@
     case 1:
     case 2:
     case 8:
-        /* variable small metrics */
+      /* variable small metrics */
       {
         TT_SBit_Small_Metrics  smetrics;
 
+        const FT_Frame_Field  sbit_small_metrics_fields[] =
+        {
+          FT_FRAME_START( 5 ),
+            FT_FRAME_BYTE( TT_SBit_Small_Metrics, height ),
+            FT_FRAME_BYTE( TT_SBit_Small_Metrics, width ),
+            FT_FRAME_CHAR( TT_SBit_Small_Metrics, bearingX ),
+            FT_FRAME_CHAR( TT_SBit_Small_Metrics, bearingY ),
+            FT_FRAME_BYTE( TT_SBit_Small_Metrics, advance ),
+          FT_FRAME_END
+        };
+
 
         /* read small metrics */
-        if ( ACCESS_Frame( 5L ) )
+        if ( READ_Fields( sbit_small_metrics_fields, &smetrics ) )
           goto Exit;
-        TT_Load_Small_SBit_Metrics( &smetrics, stream );
-        FORGET_Frame();
 
         /* convert it to a big metrics */
         metrics->height       = smetrics.height;
@@ -889,12 +840,7 @@
     case 7:
     case 9:
       /* variable big metrics */
-      {
-        if ( ACCESS_Frame( 8L ) )
-         goto Exit;
-        TT_Load_SBit_Metrics( metrics, stream );
-        FORGET_Frame();
-      }
+      (void)READ_Fields( sbit_metrics_fields, metrics );
       break;
 
     case 5:
@@ -1167,8 +1113,8 @@
       case 2:
       case 5:
       case 7:
-        line_bits  =  glyph_width * pix_bits;
-        glyph_size = (glyph_height * line_bits + 7) >> 3;
+        line_bits  =   glyph_width  * pix_bits;
+        glyph_size = ( glyph_height * line_bits + 7 ) >> 3;
         break;
 
       default:  /* invalid format */
@@ -1225,8 +1171,8 @@
       TT_Long  size;
 
 
-      map->width    = metrics->width;
-      map->rows     = metrics->height;
+      map->width = metrics->width;
+      map->rows  = metrics->height;
 
       switch ( strike->bit_depth )
       {
@@ -1234,14 +1180,17 @@
         map->pixel_mode = ft_pixel_mode_mono;
         map->pitch      = ( map->width + 7 ) >> 3;
         break;
+
       case 2:
         map->pixel_mode = ft_pixel_mode_pal2;
         map->pitch      = ( map->width + 3 ) >> 2;
         break;
+
       case 4:
         map->pixel_mode = ft_pixel_mode_pal4;
         map->pitch      = ( map->width + 1 ) >> 1;
         break;
+
       case 8:
         map->pixel_mode = ft_pixel_mode_grays;
         map->pitch      = map->width;
diff --git a/src/sfnt/ttsbit.h b/src/sfnt/ttsbit.h
index 91833c0..90ac39d 100644
--- a/src/sfnt/ttsbit.h
+++ b/src/sfnt/ttsbit.h
@@ -22,72 +22,13 @@
 #include <ttload.h>
 
 
-  /*************************************************************************/
-  /*                                                                       */
-  /* <Function>                                                            */
-  /*    TT_Load_SBit_Strikes                                               */
-  /*                                                                       */
-  /* <Description>                                                         */
-  /*    Loads the table of embedded bitmap sizes for this face.            */
-  /*                                                                       */
-  /* <Input>                                                               */
-  /*    face   :: The target face object.                                  */
-  /*    stream :: The input stream.                                        */
-  /*                                                                       */
-  /* <Return>                                                              */
-  /*    TrueType error code.  0 means success.                             */
-  /*                                                                       */
   LOCAL_DEF
   TT_Error  TT_Load_SBit_Strikes( TT_Face    face,
                                   FT_Stream  stream );
 
-
-  /*************************************************************************/
-  /*                                                                       */
-  /* <Function>                                                            */
-  /*    TT_Free_SBit_Strikes                                               */
-  /*                                                                       */
-  /* <Description>                                                         */
-  /*    Releases the embedded bitmap tables.                               */
-  /*                                                                       */
-  /* <Input>                                                               */
-  /*    face :: The target face object.                                    */
-  /*                                                                       */
   LOCAL_DEF
   void  TT_Free_SBit_Strikes( TT_Face  face );
 
-
-  /*************************************************************************/
-  /*                                                                       */
-  /* <Function>                                                            */
-  /*    TT_Load_SBit_Image                                                 */
-  /*                                                                       */
-  /* <Description>                                                         */
-  /*    Loads a given glyph sbit image from the font resource.  This also  */
-  /*    returns its metrics.                                               */
-  /*                                                                       */
-  /* <Input>                                                               */
-  /*    face        :: The target face object.                             */
-  /*                                                                       */
-  /*    x_ppem      :: The horizontal resolution in points per EM.         */
-  /*                                                                       */
-  /*    y_ppem      :: The vertical resolution in points per EM.           */
-  /*                                                                       */
-  /*    glyph_index :: The current glyph index.                            */
-  /*                                                                       */
-  /*    stream      :: The input stream.                                   */
-  /*                                                                       */
-  /* <Output>                                                              */
-  /*    map         :: The target pixmap.                                  */
-  /*    metrics     :: A big sbit metrics structure for the glyph image.   */
-  /*                                                                       */
-  /* <Return>                                                              */
-  /*    TrueType error code.  0 means success.  Returns an error if no     */
-  /*    glyph sbit exists for the index.                                   */
-  /*                                                                       */
-  /*  <Note>                                                               */
-  /*    The `map.buffer' field is always freed before the glyph is loaded. */
-  /*                                                                       */
   LOCAL_DEF
   TT_Error  TT_Load_SBit_Image( TT_Face           face,
                                 TT_Int            x_ppem,
diff --git a/src/truetype/ttgload.c b/src/truetype/ttgload.c
index 2a5ebee..86fc468 100644
--- a/src/truetype/ttgload.c
+++ b/src/truetype/ttgload.c
@@ -241,7 +241,7 @@
       goto Fail;
     }
 
-    FT_TRACE4(( "Instructions size : %d\n", n_ins ));
+    FT_TRACE5(( "  Instructions size: %d\n", n_ins ));
 
     if ( n_ins > face->max_profile.maxSizeOfInstructions )
     {
@@ -552,13 +552,12 @@
 
     FORGET_Frame();
 
-    FT_TRACE6(( "Glyph %ld\n", index ));
-    FT_TRACE6(( " # of contours : %d\n", num_contours ));
-    FT_TRACE6(( " xMin: %4d  xMax: %4d\n", loader->bbox.xMin,
-                                           loader->bbox.xMax ));
-    FT_TRACE6(( " yMin: %4d  yMax: %4d\n", loader->bbox.yMin,
-                                           loader->bbox.yMax ));
-    FT_TRACE6(( "-" ));
+    FT_TRACE5(( "Glyph %ld\n", index ));
+    FT_TRACE5(( "  # of contours: %d\n", contours_count ));
+    FT_TRACE5(( "  xMin: %4d  xMax: %4d\n", loader->bbox.xMin,
+                                            loader->bbox.xMax ));
+    FT_TRACE5(( "  yMin: %4d  yMax: %4d\n", loader->bbox.yMin,
+                                            loader->bbox.yMax ));
 
     count -= 10;
 
@@ -868,7 +867,7 @@
           /* read size of instructions */
           if ( FILE_Seek( ins_offset ) ||
                READ_UShort(n_ins)      ) goto Fail;
-          FT_TRACE4(( "Instructions size = %d\n", n_ins ));
+          FT_TRACE5(( "  Instructions size = %d\n", n_ins ));
 
           /* check it */
           if ( n_ins > face->max_profile.maxSizeOfInstructions )