Commit 8c90c22dbe0b89970f0fb878117c3c2a5e2e214c

Werner Lemberg 2002-06-08T06:47:18

* src/cache/ftccache.c (ftc_node_hash_unlink, ftc_node_hash_link) [FTC_CACHE_USE_LINEAR_HASHING]: Fix returned error code. Fix debugging messages. * src/type42/t42error.h: New file. * src/type42/t42drivr.c, src/type42/t42objs.c, src/type42/t42parse.c: Use t42 error codes. * src/type42/rules.mk: Updated. * src/base/ftnames.c: Include FT_INTERNAL_STREAM_H. Formatting, adding copyright messages.

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
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
diff --git a/ChangeLog b/ChangeLog
index c7c28cc..4158937 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,27 +1,113 @@
+2002-06-08  Werner Lemberg  <wl@gnu.org>
+
+	* src/cache/ftccache.c (ftc_node_hash_unlink, ftc_node_hash_link)
+	[FTC_CACHE_USE_LINEAR_HASHING]: Fix returned error code.
+	Fix debugging messages.
+
+	* src/type42/t42error.h: New file.
+	* src/type42/t42drivr.c, src/type42/t42objs.c,
+	src/type42/t42parse.c: Use t42 error codes.
+	* src/type42/rules.mk: Updated.
+
+	* src/base/ftnames.c: Include FT_INTERNAL_STREAM_H.
+
+2002-06-08  David Turner  <david@freetype.org>
+
+	* src/cache/ftccmap.c: GEN_CACHE_FAMILY_COMPARE,
+	GEN_CACHE_NODE_COMPARE, GEN_CACHE_LOOKUP) [FTC_CACHE_USE_INLINE]:
+	New macros.
+	(ftc_cmap_cache_lookup) [!FTC_CACHE_USE_INLINE]: Typedef to
+	ftc_cache_lookup.
+	(FTC_CMapCache_Lookup): Updated.
+
 2002-06-07  Graham Asher  <graham.asher@btinternet.com>
 
-        * include/freetype/cache/ftccache.h, src/cache/ftccache.c,
-          src/cache/ftccache.i, src/cache/ftcsbits.c: adding various
-          experimental optimisations to the cache manager
+	Adding various experimental optimizations to the cache manager.
+
+	* include/freetype/cache/ftccache.h (FTC_CACHE_USE_INLINE,
+	FTC_CACHE_USE_LINEAR_HASHING): New options.
+	(FTC_CacheRec) [FTC_CACHE_USE_LINEAR_HASHING]: New elements `p',
+	`mask', and `slack'.
+
+	* src/cache/ftccache.c (FTC_HASH_MAX_LOAD, FTC_HASH_MIN_LOAD,
+	FTC_HASH_SUB_LOAD) [FTC_CACHE_USE_LINEAR_HASHING,
+	FTC_HASH_INITIAL_SIZE]: New macros.
+	(ftc_node_mru_link, ftc_node_mru_up): Optimized.
+	(ftc_node_hash_unlink, ftc_node_hash_link)
+	[FTC_CACHE_USE_LINEAR_HASHING]: New variants.
+	(FTC_PRIMES_MIN, FTC_PRIMES_MAX, ftc_primes, ftc_prime_closest,
+	FTC_CACHE_RESIZE_TEST, ftc_cache_resize)
+	[!FTC_CACHE_USE_LINEAR_HASHING]: Define it conditionally.
+	(ftc_cache_init, ftc_cache_clear) [FTC_CACHE_USE_LINEAR_HASHING]:
+	Updated.
+	(ftc_cache_lookup) [FTC_CACHE_USE_LINEAR_HASHING]: Implement it.
+
+	* src/cache/ftccache.i: New file.
+
+	* src/cache/ftcsbits.c (GEN_CACHE_FAMILY_COMPARE,
+	GEN_CACHE_NODE_COMPARE, GEN_CACHE_LOOKUP) [FTC_CACHE_USE_INLINE]:
+	New macros.
+	(ftc_sbit_cache_lookup) [!FTC_CACHE_USE_INLINE]: Typedef to
+	ftc_cache_lookup.
+	(FTC_SBitCache_Lookup): Updated.
 
-        * src/type42/t42parse.c: removing duplicate function
+	* src/type42/t42parse.c: Removing duplicate function.
 
-        * src/base/ftobjs.c (FT_Render_Glyph_Internal): changed definition
-          from FT_EXPORT_DEF to FT_BASE_DEF
+	* src/base/ftobjs.c (FT_Render_Glyph_Internal): Changed definition
+	from FT_EXPORT_DEF to FT_BASE_DEF.
 
-2002-06-07  David Turner   <david@freetype.org>
+2002-06-07  David Turner  <david@freetype.org>
+
+	Fixed the bug that prevented the correct display of fonts with
+	"ftview".
+
+	* src/type42/t42drivr.c: Split into...
+	* src/type42/t42drivr.h, src/type42/t42parse.c,
+	src/type42/t42parse.h, src/type42/t42objs.h, src/type42/t42objs.c,
+	src/type42/type42.c: New files.
+
+	(t42_get_glyph_name, t42_get_ps_name, t42_get_name_index): Use
+	`face->type1'.
+
+	(Get_Interface): Renamed to...
+	(T42_Get_Interface): This.
+	Updated.
+	(T42_Open_Face, T42_Face_Done): Updated.
+	(T42_Face_Init): Add new cmap support.
+	Updated.
+	(T42_Driver_Init, T42_Driver_Done, T42_Size_Init, T42_Size_Done,
+	T42_GlyphSlot_Init, T42_GlyphSlot_Done): Updated.
+	(Get_Char_Index, Get_Next_Char): Renamed to...
+	(T42_CMap_CharIndex, T42_CMap_CharNext): This.
+	Updated.
+	(T42_Char_Size, T42_Pixel_Size): Renamed to...
+	(T42_Size_SetChars, T42_Size_SetPixels): This.
+	(T42_Load_Glyph): Renamed to...
+	(T42_GlyphSlot_Load): This.
+
+	(t42_init_loader, t42_done_loader): Renamed to...
+	(t42_loader_init, t42_loader_done): This.
+	(T42_New_Parser, T42_Finalize_Parser): Renamed to...
+	(t42_parser_init, t42_parser_done): This.
+	(parse_dict): Renamed to...
+	(t42_parse_dict): This.
+	(is_alpha, is_space, hexval): Renamed to...
+	(t42_is_alpha, t42_is_space, t42_hexval): This.
+	(parse_font_name, parse_font_bbox, parse_font_matrix,
+	parse_encoding, parse_sfnts, parse_charstrings, parse_dict):
+	Renamed to...
+	(t42_parse_font_name, t42_parse_font_bbox, t42_parse_font_matrix,
+	t42_parse_encoding, t42_parse_sfnts, t42_parse_charstrings,
+	t42_parse_dict): This.
+	Updated.
 
-        * src/type42/t42drivr.c, src/type42/t42drivr.h, src/type42/t42parse.c,
-          src/type42/t42parse.h, src/type42/t42objs.h, src/type42/t42objs.c,
-          src/type42/type42.c:
+	(t42_keywords): Updated.
 
-            updated the Type42 driver by splitting it into several files since
-            it makes the code easier to read and maintain. Also fixed the bug
-            that prevented the correct display of fonts with "ftview"
+	* src/type42/Jamfile, src/type42/descrip.mms: Updated.
 
 2002-06-03  Werner Lemberg  <wl@gnu.org>
 
-	Add 8bpp support.
+	Add 8bpp support to BDF driver.
 
 	* src/bdf/bdflib.c (_bdf_parse_start): Handle 8bpp.
 	* src/bdf/bdfdrivr.c (BDF_Glyph_Load): Ditto.
diff --git a/include/freetype/cache/ftccache.h b/include/freetype/cache/ftccache.h
index d45b223..1871a0f 100644
--- a/include/freetype/cache/ftccache.h
+++ b/include/freetype/cache/ftccache.h
@@ -4,7 +4,7 @@
 /*                                                                         */
 /*    FreeType internal cache interface (specification).                   */
 /*                                                                         */
-/*  Copyright 2000-2001 by                                                 */
+/*  Copyright 2000-2001, 2002 by                                           */
 /*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */
 /*                                                                         */
 /*  This file is part of the FreeType project, and may only be used,       */
@@ -26,6 +26,7 @@
 /* define to use linear hash table */
 #define  FTC_CACHE_USE_LINEAR_HASHING
 
+
 FT_BEGIN_HEADER
 
   /* handle to cache object */
diff --git a/src/base/ftnames.c b/src/base/ftnames.c
index 74d7054..7fde5c4 100644
--- a/src/base/ftnames.c
+++ b/src/base/ftnames.c
@@ -22,6 +22,7 @@
 #include <ft2build.h>
 #include FT_SFNT_NAMES_H
 #include FT_INTERNAL_TRUETYPE_TYPES_H
+#include FT_INTERNAL_STREAM_H
 
 
 #ifdef TT_CONFIG_OPTION_SFNT_NAMES
diff --git a/src/cache/ftccache.c b/src/cache/ftccache.c
index d5bcf92..ca74f4f 100644
--- a/src/cache/ftccache.c
+++ b/src/cache/ftccache.c
@@ -26,12 +26,12 @@
 
 #ifdef FTC_CACHE_USE_LINEAR_HASHING
 
-#define  FTC_HASH_MAX_LOAD  2
-#define  FTC_HASH_MIN_LOAD  1
-#define  FTC_HASH_SUB_LOAD  (FTC_HASH_MAX_LOAD-FTC_HASH_MIN_LOAD)
+#define FTC_HASH_MAX_LOAD  2
+#define FTC_HASH_MIN_LOAD  1
+#define FTC_HASH_SUB_LOAD  ( FTC_HASH_MAX_LOAD - FTC_HASH_MIN_LOAD )
 
-/* this one _must_ be a power of 2 !! */
-#define  FTC_HASH_INITIAL_SIZE  8
+/* this one _must_ be a power of 2! */
+#define FTC_HASH_INITIAL_SIZE  8
 
 #endif /* FTC_CACHE_USE_LINEAR_HASHING */
 
@@ -72,6 +72,7 @@
     {
       FTC_Node  last = first->mru_prev;
 
+
       FT_ASSERT( last->mru_next == first );
 
       node->mru_prev = last;
@@ -102,6 +103,7 @@
     FTC_Node  prev  = node->mru_prev;
     FTC_Node  next  = node->mru_next;
 
+
     FT_ASSERT( first != NULL && manager->num_nodes > 0 );
     FT_ASSERT( next->mru_prev == node );
     FT_ASSERT( prev->mru_next == node );
@@ -111,6 +113,7 @@
 
     if ( node == first )
     {
+      /* this is the last node in the list; update its head pointer */
       if ( node == next )
         manager->nodes_list = NULL;
       else
@@ -137,6 +140,7 @@
       FTC_Node  next = node->mru_next;
       FTC_Node  last;
 
+
       prev->mru_next = next;
       next->mru_prev = prev;
 
@@ -162,9 +166,10 @@
     FTC_Node  *pnode;
     FT_UInt    index, num_buckets;
 
+  
     index = (FT_UInt)( node->hash & cache->mask );
     if ( index < cache->p )
-      index = (FT_UInt)( node->hash & (2*cache->mask+1) );
+      index = (FT_UInt)( node->hash & ( 2 * cache->mask + 1 ) );
 
     pnode = cache->buckets + index;
 
@@ -172,8 +177,8 @@
     {
       if ( *pnode == NULL )
       {
-        FT_ERROR(( "FreeType.cache.hash_unlink: unknown node!\n" ));
-        return 0;
+        FT_ERROR(( "ftc_node_hash_unlink: unknown node!\n" ));
+        return FT_Err_Ok;
       }
 
       if ( *pnode == node )
@@ -186,15 +191,16 @@
       pnode = &(*pnode)->link;
     }
 
-    num_buckets = ( cache->p + cache->mask + 1) ;
+    num_buckets = ( cache->p + cache->mask + 1 );
 
-    if ( ++ cache->slack > (FT_Long)num_buckets*FTC_HASH_SUB_LOAD )
+    if ( ++cache->slack > (FT_Long)num_buckets * FTC_HASH_SUB_LOAD )
     {
       FT_UInt    p         = cache->p;
       FT_UInt    mask      = cache->mask;
       FT_UInt    old_index = p + mask;
       FTC_Node*  pold;
 
+
       FT_ASSERT( old_index >= FTC_HASH_INITIAL_SIZE );
 
       if ( p == 0 )
@@ -205,9 +211,9 @@
         cache->mask >>= 1;
         p             = cache->mask;
 
-        if ( FT_RENEW_ARRAY( cache->buckets, (mask+1)*2, (mask) ) )
+        if ( FT_RENEW_ARRAY( cache->buckets, ( mask + 1 ) * 2, mask ) )
         {
-          FT_ERROR(( "FreeType.cache.hash_unlink: couldn't shunk buckets !\n" ));
+          FT_ERROR(( "ftc_node_hash_unlink: couldn't shunk buckets!\n" ));
           goto Exit;
         }
       }
@@ -239,6 +245,7 @@
   {
     FTC_Node  *pnode = cache->buckets + ( node->hash % cache->size );
 
+
     for (;;)
     {
       if ( *pnode == NULL )
@@ -274,9 +281,10 @@
     FT_UInt    index;
     FT_Error   error = 0;
 
+
     index = (FT_UInt)( node->hash & cache->mask );
     if ( index < cache->p )
-      index = (FT_UInt)( node->hash & (2*cache->mask+1) );
+      index = (FT_UInt)( node->hash & (2 * cache->mask + 1 ) );
 
     pnode = cache->buckets + index;
 
@@ -289,16 +297,18 @@
       FT_UInt    mask  = cache->mask;
       FTC_Node   new_list;
 
+
       /* split a single bucket */
       new_list = NULL;
       pnode    = cache->buckets + p;
+
       for (;;)
       {
         node = *pnode;
         if ( node == NULL )
           break;
 
-        if ( node->hash & (mask+1) )
+        if ( node->hash & ( mask + 1 ) )
         {
           *pnode     = node->link;
           node->link = new_list;
@@ -308,7 +318,7 @@
           pnode = &node->link;
       }
 
-      cache->buckets[ p + mask + 1 ] = new_list;
+      cache->buckets[p + mask + 1] = new_list;
 
       cache->slack += FTC_HASH_MAX_LOAD;
 
@@ -317,13 +327,14 @@
         FT_Memory  memory = cache->memory;
 
 
-        if ( FT_RENEW_ARRAY( cache->buckets, (mask+1)*2, (mask+1)*4 ) )
+        if ( FT_RENEW_ARRAY( cache->buckets,
+                             ( mask + 1 ) * 2, ( mask + 1 ) * 4 ) )
         {
-          FT_ERROR(( "FreeType.cache.hash_unlink: couldn't expand buckets !\n" ));
+          FT_ERROR(( "ftc_node_hash_link: couldn't expand buckets!\n" ));
           goto Exit;
         }
 
-        cache->mask = 2*mask + 1;
+        cache->mask = 2 * mask + 1;
         cache->p    = 0;
       }
       else
@@ -343,6 +354,7 @@
   {
     FTC_Node  *pnode = cache->buckets + ( node->hash % cache->size );
 
+
     node->link = *pnode;
     *pnode     = node;
 
@@ -466,6 +478,7 @@
 
 #ifdef FTC_CACHE_USE_LINEAR_HASHING
 
+  /* nothing */
 
 #else /* !FTC_CACHE_USE_LINEAR_HASHING */
 
@@ -583,6 +596,7 @@
 
 #endif /* !FTC_CACHE_USE_LINEAR_HASHING */
 
+
   FT_EXPORT_DEF( FT_Error )
   ftc_cache_init( FTC_Cache  cache )
   {
@@ -594,13 +608,14 @@
 #ifdef FTC_CACHE_USE_LINEAR_HASHING
 
     cache->p     = 0;
-    cache->mask  = FTC_HASH_INITIAL_SIZE-1;
-    cache->slack = FTC_HASH_INITIAL_SIZE*FTC_HASH_MAX_LOAD;
+    cache->mask  = FTC_HASH_INITIAL_SIZE - 1;
+    cache->slack = FTC_HASH_INITIAL_SIZE * FTC_HASH_MAX_LOAD;
 
-    if ( FT_NEW_ARRAY( cache->buckets, FTC_HASH_INITIAL_SIZE*2 ) )
+    if ( FT_NEW_ARRAY( cache->buckets, FTC_HASH_INITIAL_SIZE * 2 ) )
       goto Exit;
 
 #else /* !FTC_CACHE_USE_LINEAR_HASHING */
+
     cache->nodes = 0;
     cache->size  = FTC_PRIMES_MIN;
 
@@ -728,7 +743,7 @@
                     FTC_Query   query,
                     FTC_Node   *anode )
   {
-    FT_Error    error = 0;
+    FT_Error    error = FT_Err_Ok;
     FT_LruNode  lru;
 
 
@@ -740,11 +755,12 @@
     query->hash   = 0;
     query->family = NULL;
 
-    /* XXX: we break encapsulation for the sake of speed !! */
 #if 1
+
+    /* XXX: we break encapsulation for the sake of speed! */
     {
       /* first of all, find the relevant family */
-      FT_LruList              list  = cache->families;
+      FT_LruList              list    = cache->families;
       FT_LruNode              fam, *pfam;
       FT_LruNode_CompareFunc  compare = list->clazz->node_compare;
 
@@ -780,27 +796,35 @@
       lru = fam;
 
     Skip:
+      ;
     }
+
 #else
+
     error = FT_LruList_Lookup( cache->families, query, &lru );
     if ( !error )
+
 #endif
     {
       FTC_Family  family = (FTC_Family) lru;
       FT_UFast    hash    = query->hash;
       FTC_Node*   bucket;
 
-
 #ifdef FTC_CACHE_USE_LINEAR_HASHING
+
       FT_UInt  index;
 
+
       index = hash & cache->mask;
       if ( index < cache->p )
-        index = hash & (cache->mask*2+1);
+        index = hash & ( cache->mask * 2 + 1 );
 
       bucket  = cache->buckets + index;
+
 #else
+
       bucket  = cache->buckets + (hash % cache->size);
+
 #endif
 
 
diff --git a/src/cache/ftccache.i b/src/cache/ftccache.i
index ca7f748..48f9568 100644
--- a/src/cache/ftccache.i
+++ b/src/cache/ftccache.i
@@ -1,11 +1,30 @@
+/***************************************************************************/
+/*                                                                         */
+/*  ftccache.i                                                             */
+/*                                                                         */
+/*    FreeType template for generic cache.                                 */
+/*                                                                         */
+/*  Copyright 2002 by                                                      */
+/*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */
+/*                                                                         */
+/*  This file is part of the FreeType project, and may only be used,       */
+/*  modified, and distributed under the terms of the FreeType project      */
+/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */
+/*  this file you indicate that you have read the license and              */
+/*  understand and accept it fully.                                        */
+/*                                                                         */
+/***************************************************************************/
+
+
 #ifndef GEN_CACHE_FAMILY_COMPARE
-#error "GEN_CACHE_FAMILY_COMPARE not defined in template instanciation"
+#error "GEN_CACHE_FAMILY_COMPARE not defined in template instantiation"
 #endif
 
 #ifndef GEN_CACHE_NODE_COMPARE
-#error "GEN_CACHE_NODE_COMPARE not defined in template instanciation"
+#error "GEN_CACHE_NODE_COMPARE not defined in template instantiation"
 #endif
 
+
   static FT_Error
   GEN_CACHE_LOOKUP( FTC_Cache   cache,
                     FTC_Query   query,
@@ -17,11 +36,12 @@
     query->hash   = 0;
     query->family = NULL;
 
-    /* XXX: we break encapsulation for the sake of speed !! */
+    /* XXX: we break encapsulation for the sake of speed! */
     {
       /* first of all, find the relevant family */
-      FT_LruList              list  = cache->families;
-      FT_LruNode              fam, *pfam;
+      FT_LruList  list  = cache->families;
+      FT_LruNode  fam, *pfam;
+
 
       pfam = &list->nodes;
       for (;;)
@@ -51,20 +71,21 @@
 
     {
       FTC_Family  family = (FTC_Family) lru;
-      FT_UFast    hash    = query->hash;
+      FT_UFast    hash   = query->hash;
       FTC_Node    node, *pnode, *bucket;
 
 
 #ifdef FTC_CACHE_USE_LINEAR_HASHING
       FT_UInt  index;
 
+
       index = hash & cache->mask;
       if ( index < cache->p )
-        index = hash & (cache->mask*2+1);
+        index = hash & ( cache->mask * 2 + 1 );
 
       bucket  = cache->buckets + index;
 #else
-      bucket  = cache->buckets + (hash % cache->size);
+      bucket  = cache->buckets + ( hash % cache->size );
 #endif
 
 #ifdef FT_DEBUG_LEVEL_ERROR
@@ -119,6 +140,7 @@
         FTC_Node     next = node->mru_next;
         FTC_Node     last;
 
+
         prev->mru_next = next;
         next->mru_prev = prev;
 
@@ -139,3 +161,6 @@
 #undef GEN_CACHE_NODE_COMPARE
 #undef GEN_CACHE_FAMILY_COMPARE
 #undef GEN_CACHE_LOOKUP
+
+
+/* END */
diff --git a/src/cache/ftccmap.c b/src/cache/ftccmap.c
index 8eb9a84..8c982c3 100644
--- a/src/cache/ftccmap.c
+++ b/src/cache/ftccmap.c
@@ -320,21 +320,23 @@
 
 #ifdef FTC_CACHE_USE_INLINE
 
-#  define GEN_CACHE_FAMILY_COMPARE(f,q,c)  \
-             ftc_cmap_family_compare( (FTC_CMapFamily)(f), (FTC_CMapQuery)(q) )
+#define GEN_CACHE_FAMILY_COMPARE( f, q, c ) \
+          ftc_cmap_family_compare( (FTC_CMapFamily)(f), (FTC_CMapQuery)(q) )
 
-#  define GEN_CACHE_NODE_COMPARE(n,q,c)  \
-             ftc_cmap_node_compare( (FTC_CMapNode)(n), (FTC_CMapQuery)(q) )
+#define GEN_CACHE_NODE_COMPARE( n, q, c ) \
+          ftc_cmap_node_compare( (FTC_CMapNode)(n), (FTC_CMapQuery)(q) )
 
-#  define GEN_CACHE_LOOKUP          ftc_cmap_cache_lookup
-#  include "ftccache.i"
+#define GEN_CACHE_LOOKUP  ftc_cmap_cache_lookup
+
+#include "ftccache.i"
 
 #else  /* !FTC_CACHE_USE_INLINE */
 
-#  define ftc_cmap_cache_lookup  ftc_cache_lookup
+#define ftc_cmap_cache_lookup  ftc_cache_lookup
 
 #endif /* !FTC_CACHE_USE_INLINE */
 
+
   /* documentation is in ftccmap.h */
 
   FT_EXPORT_DEF( FT_UInt )
diff --git a/src/cache/ftcsbits.c b/src/cache/ftcsbits.c
index 25056e3..5b8ff1e 100644
--- a/src/cache/ftcsbits.c
+++ b/src/cache/ftcsbits.c
@@ -464,18 +464,18 @@
 
 #ifdef FTC_CACHE_USE_INLINE
 
-#  define GEN_CACHE_FAMILY_COMPARE(f,q,c)  \
-             ftc_sbit_family_compare( (FTC_SBitFamily)(f), (FTC_SBitQuery)(q) )
+#define GEN_CACHE_FAMILY_COMPARE( f, q, c ) \
+          ftc_sbit_family_compare( (FTC_SBitFamily)(f), (FTC_SBitQuery)(q) )
 
-#  define GEN_CACHE_NODE_COMPARE(n,q,c)  \
-             ftc_sbit_node_compare( (FTC_SBitNode)(n), (FTC_SBitQuery)(q), c )
+#define GEN_CACHE_NODE_COMPARE( n, q, c ) \
+          ftc_sbit_node_compare( (FTC_SBitNode)(n), (FTC_SBitQuery)(q), c )
 
-#  define GEN_CACHE_LOOKUP          ftc_sbit_cache_lookup
-#  include "ftccache.i"
+#define GEN_CACHE_LOOKUP  ftc_sbit_cache_lookup
+#include "ftccache.i"
 
 #else  /* !FTC_CACHE_USE_INLINE */
 
-#  define ftc_sbit_cache_lookup  ftc_cache_lookup
+#define ftc_sbit_cache_lookup  ftc_cache_lookup
 
 #endif /* !FTC_CACHE_USE_INLINE */
 
diff --git a/src/type42/rules.mk b/src/type42/rules.mk
index 02cca1f..f991449 100644
--- a/src/type42/rules.mk
+++ b/src/type42/rules.mk
@@ -32,7 +32,8 @@ T42_DRV_SRC := $(T42_DIR_)t42objs.c  \
 
 # Type42 driver headers
 #
-T42_DRV_H := $(T42_DRV_SRC:%.c=%.h)
+T42_DRV_H := $(T42_DRV_SRC:%.c=%.h) \
+             $(T42_DIR_)t42error.h
 
 
 # Type42 driver object(s)
diff --git a/src/type42/t42drivr.c b/src/type42/t42drivr.c
index 3983677..3e01498 100644
--- a/src/type42/t42drivr.c
+++ b/src/type42/t42drivr.c
@@ -1,10 +1,30 @@
+/***************************************************************************/
+/*                                                                         */
+/*  t42drivr.c                                                             */
+/*                                                                         */
+/*    High-level Type 42 driver interface (body).                          */
+/*                                                                         */
+/*  Copyright 2002 by Roberto Alameda.                                     */
+/*                                                                         */
+/*  This file is part of the FreeType project, and may only be used,       */
+/*  modified, and distributed under the terms of the FreeType project      */
+/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */
+/*  this file you indicate that you have read the license and              */
+/*  understand and accept it fully.                                        */
+/*                                                                         */
+/***************************************************************************/
+
+
 #include "t42drivr.h"
 #include "t42objs.h"
+#include "t42error.h"
 #include FT_INTERNAL_DEBUG_H
 
+
 #undef  FT_COMPONENT
 #define FT_COMPONENT  trace_t42
 
+
   static FT_Error
   t42_get_glyph_name( T42_Face    face,
                       FT_UInt     glyph_index,
@@ -28,7 +48,7 @@
       ((FT_Byte*)buffer)[len] = 0;
     }
 
-    return FT_Err_Ok;
+    return T42_Err_Ok;
   }
 
 
@@ -127,3 +147,5 @@
     (FT_CharMap_CharNextFunc) T42_CMap_CharNext,
   };
 
+
+/* END */
diff --git a/src/type42/t42drivr.h b/src/type42/t42drivr.h
index cfa8fcf..98b7410 100644
--- a/src/type42/t42drivr.h
+++ b/src/type42/t42drivr.h
@@ -4,8 +4,7 @@
 /*                                                                         */
 /*    High-level Type 42 driver interface (specification).                 */
 /*                                                                         */
-/*  Copyright 1996-2001, 2002 by                                           */
-/*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */
+/*  Copyright 2002 by Roberto Alameda.                                     */
 /*                                                                         */
 /*  This file is part of the FreeType project, and may only be used,       */
 /*  modified, and distributed under the terms of the FreeType project      */
@@ -16,8 +15,8 @@
 /***************************************************************************/
 
 
-#ifndef __T42DRIVER_H__
-#define __T42DRIVER_H__
+#ifndef __T42DRIVR_H__
+#define __T42DRIVR_H__
 
 
 #include <ft2build.h>
@@ -32,7 +31,8 @@ FT_BEGIN_HEADER
 
 FT_END_HEADER
 
-#endif /* __T42DRIVER_H__ */
+
+#endif /* __T42DRIVR_H__ */
 
 
 /* END */
diff --git a/src/type42/t42objs.c b/src/type42/t42objs.c
index bb9f4ba..e22d833 100644
--- a/src/type42/t42objs.c
+++ b/src/type42/t42objs.c
@@ -1,9 +1,28 @@
+/***************************************************************************/
+/*                                                                         */
+/*  t42objs.c                                                              */
+/*                                                                         */
+/*    Type 42 objects manager (body).                                      */
+/*                                                                         */
+/*  Copyright 2002 by Roberto Alameda.                                     */
+/*                                                                         */
+/*  This file is part of the FreeType project, and may only be used,       */
+/*  modified, and distributed under the terms of the FreeType project      */
+/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */
+/*  this file you indicate that you have read the license and              */
+/*  understand and accept it fully.                                        */
+/*                                                                         */
+/***************************************************************************/
+
+
 #include "t42objs.h"
 #include "t42parse.h"
+#include "t42error.h"
 #include FT_INTERNAL_DEBUG_H
 #include FT_INTERNAL_STREAM_H
 #include FT_LIST_H
 
+
 #undef  FT_COMPONENT
 #define FT_COMPONENT  trace_t42
 
@@ -38,7 +57,7 @@
 
     if ( type1->font_type != 42 )
     {
-      error = FT_Err_Unknown_File_Format;
+      error = T42_Err_Unknown_File_Format;
       goto Exit;
     }
 
@@ -48,18 +67,18 @@
 
     if ( !loader.charstrings.init ) {
       FT_ERROR(( "T42_Open_Face: no charstrings array in face!\n" ));
-      error = FT_Err_Invalid_File_Format;
+      error = T42_Err_Invalid_File_Format;
     }
 
-    loader.charstrings.init   = 0;
+    loader.charstrings.init  = 0;
     type1->charstrings_block = loader.charstrings.block;
     type1->charstrings       = loader.charstrings.elements;
     type1->charstrings_len   = loader.charstrings.lengths;
 
     /* we copy the glyph names `block' and `elements' fields; */
     /* the `lengths' field must be released later             */
-    type1->glyph_names_block   = loader.glyph_names.block;
-    type1->glyph_names         = (FT_String**)loader.glyph_names.elements;
+    type1->glyph_names_block    = loader.glyph_names.block;
+    type1->glyph_names          = (FT_String**)loader.glyph_names.elements;
     loader.glyph_names.block    = 0;
     loader.glyph_names.elements = 0;
 
@@ -165,7 +184,7 @@
     if ( face_index != 0 )
     {
       FT_ERROR(( "T42_Face_Init: invalid face index\n" ));
-      error = FT_Err_Invalid_Argument;
+      error = T42_Err_Invalid_Argument;
       goto Exit;
     }
 
@@ -176,7 +195,7 @@
 
     root->num_glyphs   = face->type1.num_glyphs;
     root->num_charmaps = 0;
-    root->face_index  = face_index;
+    root->face_index   = face_index;
 
     root->face_flags  = FT_FACE_FLAG_SCALABLE;
     root->face_flags |= FT_FACE_FLAG_HORIZONTAL;
@@ -242,7 +261,7 @@
     root->descender = face->ttf_face->descender;
     root->height    = face->ttf_face->height;
 
-    root->max_advance_width = face->ttf_face->max_advance_width;
+    root->max_advance_width  = face->ttf_face->max_advance_width;
     root->max_advance_height = face->ttf_face->max_advance_height;
 
     root->underline_position  = face->type1.font_info.underline_position;
@@ -318,9 +337,9 @@
         if ( clazz )
           FT_CMap_New( clazz, NULL, &charmap, NULL );
 
-	/* Select default charmap */
-	if (root->num_charmaps)
-	  root->charmap = root->charmaps[0];
+        /* Select default charmap */
+        if (root->num_charmaps)
+          root->charmap = root->charmaps[0];
       }
     }
 
@@ -328,31 +347,32 @@
 
     /* charmap support -- synthetize unicode charmap if possible */
     {
-      FT_CharMap        charmap = face->charmaprecs;
+      FT_CharMap  charmap = face->charmaprecs;
+
       
       /* synthesize a Unicode charmap if there is support in the `PSNames' */
       /* module                                                            */
       if ( psnames && psnames->unicode_value )
       {
-	error = psnames->build_unicodes( root->memory,
-					 face->type1.num_glyphs,
-					 (const char**)face->type1.glyph_names,
-					 &face->unicode_map );
-	if ( !error )
-	{
-	  root->charmap        = charmap;
-	  charmap->face        = (FT_Face)face;
-	  charmap->encoding    = ft_encoding_unicode;
-	  charmap->platform_id = 3;
-	  charmap->encoding_id = 1;
-	  charmap++;
-	}
-	
-	/* XXX: Is the following code correct?  It is used in t1objs.c */
-	
-	/* simply clear the error in case of failure (which really) */
-	/* means that out of memory or no unicode glyph names       */
-	error = FT_Err_Ok;
+        error = psnames->build_unicodes( root->memory,
+                                         face->type1.num_glyphs,
+                                         (const char**)face->type1.glyph_names,
+                                         &face->unicode_map );
+        if ( !error )
+        {
+          root->charmap        = charmap;
+          charmap->face        = (FT_Face)face;
+          charmap->encoding    = ft_encoding_unicode;
+          charmap->platform_id = 3;
+          charmap->encoding_id = 1;
+          charmap++;
+        }
+        
+        /* XXX: Is the following code correct?  It is used in t1objs.c */
+        
+        /* simply clear the error in case of failure (which really) */
+        /* means that out of memory or no unicode glyph names       */
+        error = T42_Err_Ok;
       }
       
       /* now, support either the standard, expert, or custom encoding */
@@ -362,29 +382,29 @@
       switch ( face->type1.encoding_type )
       {
       case T1_ENCODING_TYPE_STANDARD:
-	charmap->encoding    = ft_encoding_adobe_standard;
-	charmap->encoding_id = 0;
-	break;
-	
+        charmap->encoding    = ft_encoding_adobe_standard;
+        charmap->encoding_id = 0;
+        break;
+        
       case T1_ENCODING_TYPE_EXPERT:
-	charmap->encoding    = ft_encoding_adobe_expert;
-	charmap->encoding_id = 1;
-	break;
-	
+        charmap->encoding    = ft_encoding_adobe_expert;
+        charmap->encoding_id = 1;
+        break;
+        
       case T1_ENCODING_TYPE_ARRAY:
-	charmap->encoding    = ft_encoding_adobe_custom;
-	charmap->encoding_id = 2;
-	break;
-	
+        charmap->encoding    = ft_encoding_adobe_custom;
+        charmap->encoding_id = 2;
+        break;
+        
       case T1_ENCODING_TYPE_ISOLATIN1:
-	charmap->encoding    = ft_encoding_latin_1;
-	charmap->encoding_id = 3;
-	break;
-	
+        charmap->encoding    = ft_encoding_latin_1;
+        charmap->encoding_id = 3;
+        break;
+        
       default:
-	FT_ERROR(( "T42_Face_Init: invalid encoding\n" ));
-	error = FT_Err_Invalid_File_Format;
-	goto Exit;
+        FT_ERROR(( "T42_Face_Init: invalid encoding\n" ));
+        error = T42_Err_Invalid_File_Format;
+        goto Exit;
       }
       
       root->charmaps     = face->charmaps;
@@ -410,7 +430,7 @@
 
     if ( face )
     {
-      type1 = &face->type1;
+      type1  = &face->type1;
       info   = &type1->font_info;
       memory = face->root.memory;
 
@@ -454,6 +474,7 @@
     }
   }
 
+
   /*************************************************************************/
   /*                                                                       */
   /* <Function>                                                            */
@@ -477,7 +498,7 @@
     ttmodule = FT_Get_Module( FT_MODULE(driver)->library, "truetype" );
     driver->ttclazz = (FT_Driver_Class)ttmodule->clazz;
 
-    return FT_Err_Ok;
+    return T42_Err_Ok;
   }
 
 
@@ -608,7 +629,7 @@
     FT_Face   face = size->root.face;
     T42_Face  t42face = (T42_Face)face;
     FT_Size   ttsize;
-    FT_Error  error   = FT_Err_Ok;
+    FT_Error  error   = T42_Err_Ok;
 
 
     error = FT_New_Size( t42face->ttf_face, &ttsize );
@@ -641,7 +662,7 @@
     FT_Face       face    = slot->root.face;
     T42_Face      t42face = (T42_Face)face;
     FT_GlyphSlot  ttslot;
-    FT_Error      error   = FT_Err_Ok;
+    FT_Error      error   = T42_Err_Ok;
 
 
     if ( face->glyph == NULL )
@@ -879,3 +900,5 @@
     return 0;
   }
 
+
+/* END */
diff --git a/src/type42/t42objs.h b/src/type42/t42objs.h
index 04db2cd..717b107 100644
--- a/src/type42/t42objs.h
+++ b/src/type42/t42objs.h
@@ -1,5 +1,22 @@
-#ifndef __TYPE42_OBJS_H__
-#define __TYPE42_OBJS_H__
+/***************************************************************************/
+/*                                                                         */
+/*  t42objs.h                                                              */
+/*                                                                         */
+/*    Type 42 objects manager (specification).                             */
+/*                                                                         */
+/*  Copyright 2002 by Roberto Alameda.                                     */
+/*                                                                         */
+/*  This file is part of the FreeType project, and may only be used,       */
+/*  modified, and distributed under the terms of the FreeType project      */
+/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */
+/*  this file you indicate that you have read the license and              */
+/*  understand and accept it fully.                                        */
+/*                                                                         */
+/***************************************************************************/
+
+
+#ifndef __T42OBJS_H__
+#define __T42OBJS_H__
 
 #include <ft2build.h>
 #include FT_FREETYPE_H
@@ -10,9 +27,10 @@
 #include FT_INTERNAL_POSTSCRIPT_NAMES_H
 #include FT_INTERNAL_POSTSCRIPT_HINTS_H
 
+
 FT_BEGIN_HEADER
 
- /* Type42 face */
+  /* Type42 face */
   typedef struct  T42_FaceRec_
   {
     FT_FaceRec     root;
@@ -32,8 +50,7 @@ FT_BEGIN_HEADER
   } T42_FaceRec, *T42_Face;
 
 
-
- /* Type42 size */
+  /* Type42 size */
   typedef struct  T42_SizeRec_
   {
     FT_SizeRec  root;
@@ -42,7 +59,7 @@ FT_BEGIN_HEADER
   } T42_SizeRec, *T42_Size;
 
 
- /* Type42 slot */
+  /* Type42 slot */
   typedef struct  T42_GlyphSlotRec_
   {
     FT_GlyphSlotRec  root;
@@ -51,7 +68,7 @@ FT_BEGIN_HEADER
   } T42_GlyphSlotRec, *T42_GlyphSlot;
 
 
- /* Type 42 driver */
+  /* Type 42 driver */
   typedef struct  T42_DriverRec_
   {
     FT_DriverRec     root;
@@ -60,7 +77,9 @@ FT_BEGIN_HEADER
 
   } T42_DriverRec, *T42_Driver;
 
- /* */
+
+  /* */
+
 
   FT_LOCAL( FT_Error )
   T42_Face_Init( FT_Stream      stream,
@@ -127,4 +146,8 @@ FT_BEGIN_HEADER
 
 FT_END_HEADER
 
-#endif /* __TYPE42_OBJS_H__ */
+
+#endif /* __T42OBJS_H__ */
+
+
+/* END */
diff --git a/src/type42/t42parse.c b/src/type42/t42parse.c
index 870d2ee..5a0e23e 100644
--- a/src/type42/t42parse.c
+++ b/src/type42/t42parse.c
@@ -1,9 +1,28 @@
+/***************************************************************************/
+/*                                                                         */
+/*  t42parse.c                                                             */
+/*                                                                         */
+/*    Type 42 font parser (body).                                          */
+/*                                                                         */
+/*  Copyright 2002 by Roberto Alameda.                                     */
+/*                                                                         */
+/*  This file is part of the FreeType project, and may only be used,       */
+/*  modified, and distributed under the terms of the FreeType project      */
+/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */
+/*  this file you indicate that you have read the license and              */
+/*  understand and accept it fully.                                        */
+/*                                                                         */
+/***************************************************************************/
+
+
 #include "t42parse.h"
+#include "t42error.h"
 #include FT_INTERNAL_DEBUG_H
 #include FT_INTERNAL_STREAM_H
 #include FT_LIST_H
 #include FT_INTERNAL_POSTSCRIPT_AUX_H
 
+
   /*************************************************************************/
   /*                                                                       */
   /* The macro FT_COMPONENT is used in trace mode.  It is an implicit      */
@@ -13,6 +32,7 @@
 #undef  FT_COMPONENT
 #define FT_COMPONENT  trace_t42
 
+
   static void
   t42_parse_font_name( T42_Face    face,
                        T42_Loader  loader );
@@ -118,7 +138,7 @@
                    FT_Memory      memory,
                    PSAux_Service  psaux )
   {
-    FT_Error  error = FT_Err_Ok;
+    FT_Error  error = T42_Err_Ok;
     FT_Long   size;
 
 
@@ -165,8 +185,8 @@
     else
     {
       /* read segment in memory */
-      if ( FT_ALLOC( parser->base_dict, size )      ||
-          FT_STREAM_READ( parser->base_dict, size ) )
+      if ( FT_ALLOC( parser->base_dict, size )       ||
+           FT_STREAM_READ( parser->base_dict, size ) )
         goto Exit;
 
       parser->base_len = size;
@@ -176,7 +196,7 @@
     if (size <= 17                                    ||
         ( ft_strncmp( (const char*)parser->base_dict,
                       "%!PS-TrueTypeFont", 17) )      )
-      error = FT_Err_Unknown_File_Format;
+      error = T42_Err_Unknown_File_Format;
     else
     {
       parser->root.base   = parser->base_dict;
@@ -346,7 +366,7 @@
       if ( cur >= limit )
       {
         FT_ERROR(( "t42_parse_encoding: out of bounds!\n" ));
-        parser->root.error = FT_Err_Invalid_File_Format;
+        parser->root.error = T42_Err_Invalid_File_Format;
         return;
       }
     }
@@ -485,7 +505,7 @@
 
       else {
         FT_ERROR(( "t42_parse_encoding: invalid token!\n" ));
-        parser->root.error = FT_Err_Invalid_File_Format;
+        parser->root.error = T42_Err_Invalid_File_Format;
       }
     }
   }
@@ -549,7 +569,7 @@
     else
     {
       FT_ERROR(( "t42_parse_sfnts: can't find begin of sfnts vector!\n" ));
-      error = FT_Err_Invalid_File_Format;
+      error = T42_Err_Invalid_File_Format;
       goto Fail;
     }
 
@@ -574,7 +594,7 @@
         if ( !in_string )
         {
           FT_ERROR(( "t42_parse_sfnts: found unpaired `>'!\n" ));
-          error = FT_Err_Invalid_File_Format;
+          error = T42_Err_Invalid_File_Format;
           goto Fail;
         }
 
@@ -597,7 +617,7 @@
         else
         {
           FT_ERROR(( "t42_parse_sfnts: found `%' in string!\n" ));
-          error = FT_Err_Invalid_File_Format;
+          error = T42_Err_Invalid_File_Format;
           goto Fail;
         }
 
@@ -605,7 +625,7 @@
         if ( !ft_xdigit( *cur ) || !ft_xdigit( *(cur + 1) ) )
         {
           FT_ERROR(( "t42_parse_sfnts: found non-hex characters in string" ));
-          error = FT_Err_Invalid_File_Format;
+          error = T42_Err_Invalid_File_Format;
           goto Fail;
         }
 
@@ -670,7 +690,7 @@
     }
 
     /* If control reaches this point, the format was not valid */
-    error = FT_Err_Invalid_File_Format;
+    error = T42_Err_Invalid_File_Format;
 
   Fail:
     parser->root.error = error;
@@ -780,7 +800,7 @@
     if ( ft_strcmp( (char *)name_table->elements[0], ".notdef" ) )
     {
       FT_ERROR(( "t42_parse_charstrings: Index 0 is not `.notdef'!\n" ));
-      error = FT_Err_Invalid_File_Format;
+      error = T42_Err_Invalid_File_Format;
       goto Fail;
     }
 
@@ -970,3 +990,4 @@
   }
 
 
+/* END */
diff --git a/src/type42/t42parse.h b/src/type42/t42parse.h
index 342298f..9bcb657 100644
--- a/src/type42/t42parse.h
+++ b/src/type42/t42parse.h
@@ -1,9 +1,28 @@
-#ifndef __TYPE42_PARSE_H__
-#define __TYPE42_PARSE_H__
+/***************************************************************************/
+/*                                                                         */
+/*  t42parse.h                                                             */
+/*                                                                         */
+/*    Type 42 font parser (specification).                                 */
+/*                                                                         */
+/*  Copyright 2002 by Roberto Alameda.                                     */
+/*                                                                         */
+/*  This file is part of the FreeType project, and may only be used,       */
+/*  modified, and distributed under the terms of the FreeType project      */
+/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */
+/*  this file you indicate that you have read the license and              */
+/*  understand and accept it fully.                                        */
+/*                                                                         */
+/***************************************************************************/
+
+
+#ifndef __T42PARSE_H__
+#define __T42PARSE_H__
+
 
 #include "t42objs.h"
 #include FT_INTERNAL_POSTSCRIPT_AUX_H
 
+
 FT_BEGIN_HEADER
 
   typedef struct  T42_ParserRec_
@@ -63,4 +82,8 @@ FT_BEGIN_HEADER
 
 FT_END_HEADER
 
-#endif /* __TYPE42_PARSE_H__ */
+
+#endif /* __T42PARSE_H__ */
+
+
+/* END */
diff --git a/src/type42/type42.c b/src/type42/type42.c
index 46d08ed..d13df56 100644
--- a/src/type42/type42.c
+++ b/src/type42/type42.c
@@ -1,12 +1,20 @@
 /***************************************************************************/
 /*                                                                         */
-/*  type42c                                                                */
+/*  type42.c                                                               */
 /*                                                                         */
-/*    FreeType Type 42 driver component                                    */
+/*    FreeType Type 42 driver component.                                   */
+/*                                                                         */
+/*  Copyright 2002 by                                                      */
+/*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */
+/*                                                                         */
+/*  This file is part of the FreeType project, and may only be used,       */
+/*  modified, and distributed under the terms of the FreeType project      */
+/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */
+/*  this file you indicate that you have read the license and              */
+/*  understand and accept it fully.                                        */
 /*                                                                         */
 /***************************************************************************/
 
-
 #define FT_MAKE_OPTION_SINGLE_OBJECT
 
 #include <ft2build.h>