Commit 0db8d1ab84d3bbde5d1c77e8e932120bee3f1a06

Werner Lemberg 2000-01-09T17:54:56

Formatting.

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
diff --git a/src/base/ftbbox.c b/src/base/ftbbox.c
index 6cd35d8..0ccf5cc 100644
--- a/src/base/ftbbox.c
+++ b/src/base/ftbbox.c
@@ -15,7 +15,6 @@
 /*                                                                         */
 /***************************************************************************/
 
-
   /*************************************************************************/
   /*                                                                       */
   /* This component has a _single_ role: to compute exact outline bounding */
diff --git a/src/base/ftdebug.h b/src/base/ftdebug.h
index b521e3f..2e90646 100644
--- a/src/base/ftdebug.h
+++ b/src/base/ftdebug.h
@@ -15,7 +15,6 @@
 /*                                                                         */
 /***************************************************************************/
 
-
   /*************************************************************************/
   /*                                                                       */
   /* This component contains various macros and functions used to ease the */
diff --git a/src/base/ftdriver.h b/src/base/ftdriver.h
index 7db8d49..2091913 100644
--- a/src/base/ftdriver.h
+++ b/src/base/ftdriver.h
@@ -42,7 +42,7 @@
   /*    A driver method used to create a new driver object for a given     */
   /*    format.                                                            */
   /*                                                                       */
-  /* <Input>                                                               */
+  /* <InOut>                                                               */
   /*    driver :: A handle to the `new' driver object.  The fields         */
   /*              `library', `system', and `lock' are already set when the */
   /*              base layer calls this method.                            */
@@ -64,7 +64,7 @@
   /*    this call, and that this function should NOT destroy the driver    */
   /*    object.                                                            */
   /*                                                                       */
-  /* <Input>                                                               */
+  /* <InOut>                                                               */
   /*    driver :: A handle to target driver object.                        */
   /*                                                                       */
   /* <Return>                                                              */
@@ -72,7 +72,6 @@
   /*                                                                       */
   typedef FT_Error  (*FTDriver_doneDriver)( FT_Driver  driver );
 
-
   
   /*************************************************************************/
   /*                                                                       */
@@ -88,10 +87,12 @@
   /*    `postscript names' interface which can be used to retrieve the     */
   /*     PostScript name of a given glyph index).                          */
   /*                                                                       */
-  /* <Input>                                                               */
+  /* <InOut>                                                               */
   /*    driver    :: A handle to a driver object.                          */
-  /*    interface :: A string designing the interface.  Examples           */
-  /*                 are `sfnt', `post_names', `charmaps', etc.            */
+  /*                                                                       */
+  /* <Input>                                                               */
+  /*    interface :: A string designing the interface.  Examples are       */
+  /*                 `sfnt', `post_names', `charmaps', etc.                */
   /*                                                                       */
   /* <Return>                                                              */
   /*    A typeless pointer to the extension's interface (normally a table  */
@@ -140,10 +141,14 @@
   /*    A driver method used to initialize a new face object.  The object  */
   /*    must be created by the caller.                                     */
   /*                                                                       */
-  /* <Input>                                                               */
+  /* <InOut>                                                               */
   /*    stream         :: The input stream.                                */
+  /*                                                                       */
+  /* <Input>                                                               */
   /*    typeface_index :: The face index in the font resource.  Used to    */
   /*                      access individual faces in collections.          */
+  /*                                                                       */
+  /* <Output>                                                              */
   /*    face           :: A handle to the new target face.                 */
   /*                                                                       */
   /* <Return>                                                              */
@@ -174,7 +179,7 @@
   /*    function does NOT destroy the object, that is the responsibility   */
   /*    of the caller.                                                     */
   /*                                                                       */
-  /* <Input>                                                               */
+  /* <InOut>                                                               */
   /*    face :: A handle to the target face object.                        */
   /*                                                                       */
   /* <Return>                                                              */
@@ -242,7 +247,7 @@
   /*    A driver method used to initialize a new size object.  The object  */
   /*    must be created by the caller.                                     */
   /*                                                                       */
-  /* <Input>                                                               */
+  /* <InOut>                                                               */
   /*    size :: A handle to the new size object.                           */
   /*                                                                       */
   /* <Return>                                                              */
@@ -264,8 +269,10 @@
   /*    A driver method used to reset a size's character sizes (horizontal */
   /*    and vertical) expressed in fractional points.                      */
   /*                                                                       */
-  /* <Input>                                                               */
+  /* <InOut>                                                               */
   /*    size            :: A handle to the target size object.             */
+  /*                                                                       */
+  /* <Input>                                                               */
   /*    char_width      :: The character width expressed in 26.6           */
   /*                       fractional points.                              */
   /*    char_height     :: The character height expressed in 26.6          */
@@ -296,8 +303,10 @@
   /*    A driver method used to reset a size's character sizes (horizontal */
   /*    and vertical) expressed in integer pixels.                         */
   /*                                                                       */
-  /* <Input>                                                               */
+  /* <InOut>                                                               */
   /*    size         :: A handle to the target size object.                */
+  /*                                                                       */
+  /* <Input>                                                               */
   /*    pixel_width  :: The character width expressed in 26.6 fractional   */
   /*                    pixels.                                            */
   /*    pixel_height :: The character height expressed in 26.6 fractional  */
@@ -307,7 +316,7 @@
   /*    FreeType error code.  0 means success.                             */
   /*                                                                       */
   /* <Note>                                                                */
-  /*    This function should work with all kinds of `Size' objects, either */
+  /*    This function should work with all kinds of `size' objects, either */
   /*    fixed or scalable ones.                                            */
   /*                                                                       */
   typedef FT_Error  (*FTDriver_setPixelSizes)( FT_Size  size,
@@ -325,7 +334,7 @@
   /*    does NOT destroy the object; this is the responsibility of the     */
   /*    caller.                                                            */
   /*                                                                       */
-  /* <Input>                                                               */
+  /* <InOut>                                                               */
   /*    size :: A handle to the target size object.                        */
   /*                                                                       */
   typedef void  (*FTDriver_doneSize)( FT_Size  size );
@@ -356,7 +365,7 @@
   /*    container where a single glyph can be loaded, either in outline or */
   /*    bitmap format.                                                     */
   /*                                                                       */
-  /* <Input>                                                               */
+  /* <InOut>                                                               */
   /*    slot :: A handle to the new glyph slot object.                     */
   /*                                                                       */
   /* <Return>                                                              */
@@ -374,7 +383,7 @@
   /*    A driver method used to finalize a given glyph slot.  The object   */
   /*    is not destroyed by this function.                                 */
   /*                                                                       */
-  /* <Input>                                                               */
+  /* <InOut>                                                               */
   /*    slot :: A handle to the new glyph slot object.                     */
   /*                                                                       */
   typedef void  (*FTDriver_doneGlyphSlot)( FT_GlyphSlot  slot );
@@ -388,11 +397,13 @@
   /* <Description>                                                         */
   /*    A driver method used to load a glyph within a given glyph slot.    */
   /*                                                                       */
-  /* <Input>                                                               */
+  /* <InOut>                                                               */
   /*    slot        :: A handle to target slot object where the glyph will */
   /*                   be loaded.                                          */
   /*    size        :: A handle to the source face size at which the glyph */
   /*                   must be scaled/loaded.                              */
+  /*                                                                       */
+  /* <Input>                                                               */
   /*    glyph_index :: The index of the glyph in the font file.            */
   /*    load_flags  :: A flag indicating what to load for this glyph.  The */
   /*                   FTLOAD_??? constants can be used to control the     */
diff --git a/src/base/ftextend.c b/src/base/ftextend.c
index 415d38b..0cc0df3 100644
--- a/src/base/ftextend.c
+++ b/src/base/ftextend.c
@@ -1,34 +1,38 @@
-/*******************************************************************
- *
- *  ftextend.h                                                   2.0
- *
- *    Extensions Implementation
- *
- *  Copyright 1996-1999 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.
- *
- *  This is an updated version of the extension component, now
- *  located in the main library's source directory.  It allows
- *  the dynamic registration/use of various face object extensions
- *  through a simple API.
- *
- ******************************************************************/
-
-#include "ftextend.h"
-#include "ftobjs.h"
+/***************************************************************************/
+/*                                                                         */
+/*  ftextend.h                                                             */
+/*                                                                         */
+/*  FreeType extensions implementation (body).                             */
+/*                                                                         */
+/*  Copyright 1996-2000 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.                                        */
+/*                                                                         */
+/***************************************************************************/
+
+  /*************************************************************************/
+  /*                                                                       */
+  /*  This is an updated version of the extension component, now located   */
+  /*  in the main library's source directory.  It allows the dynamic       */
+  /*  registration/use of various face object extensions through a simple  */
+  /*  API.                                                                 */
+  /*                                                                       */
+  /*************************************************************************/
+
+#include <ftextend.h>
+#include <ftobjs.h>
 
 /* required by the tracing mode */
 #undef  FT_COMPONENT
-#define FT_COMPONENT      trace_extend
+#define FT_COMPONENT  trace_extend
 
 
-  typedef struct FT_Extension_Registry_
+  typedef struct  FT_Extension_Registry_
   {
     FT_Int              num_extensions;
     FT_Long             cur_offset;
@@ -37,17 +41,30 @@
   } FT_Extension_Registry;
 
 
-  /* Initialize the extension component */
-
+  /*************************************************************************/
+  /*                                                                       */
+  /* <Function>                                                            */
+  /*    FT_Init_Extensions                                                 */
+  /*                                                                       */
+  /* <Description>                                                         */
+  /*    Initializes the extension component.                               */
+  /*                                                                       */
+  /* <InOut>                                                               */
+  /*    driver :: A handle to the driver object.                           */
+  /*                                                                       */
+  /* <Return>                                                              */
+  /*    FreeType error code.  0 means success.                             */
+  /*                                                                       */
   LOCAL_FUNC
   FT_Error  FT_Init_Extensions( FT_Driver  driver )
   {
-  FT_Error                error;
+    FT_Error                error;
     FT_Memory               memory;
     FT_Extension_Registry*  registry;
 
+
     memory = driver->library->memory;
-    if ( ALLOC( registry, sizeof (*registry) ) )
+    if ( ALLOC( registry, sizeof ( *registry ) ) )
       return error;
 
     registry->num_extensions = 0;
@@ -58,36 +75,64 @@
   }
 
 
-  /* Finalize the extension component */
-
+  /*************************************************************************/
+  /*                                                                       */
+  /* <Function>                                                            */
+  /*    FT_Done_Extensions                                                 */
+  /*                                                                       */
+  /* <Description>                                                         */
+  /*    Finalizes the extension component.                                 */
+  /*                                                                       */
+  /* <InOut>                                                               */
+  /*    driver :: A handle to the driver object.                           */
+  /*                                                                       */
+  /* <Return>                                                              */
+  /*    FreeType error code.  0 means success.                             */
+  /*                                                                       */
   LOCAL_FUNC
   FT_Error  FT_Done_Extensions( FT_Driver  driver )
   {
     FT_Memory  memory = driver->memory;
+
     
     FREE( driver->extensions );
     return FT_Err_Ok;
   }
 
 
-  /* Register a new extension */
-
+  /*************************************************************************/
+  /*                                                                       */
+  /* <Function>                                                            */
+  /*    FT_Register_Extension                                              */
+  /*                                                                       */
+  /* <Description>                                                         */
+  /*    Registers a new extension.                                         */
+  /*                                                                       */
+  /* <InOut>                                                               */
+  /*    driver :: A handle to the driver object.                           */
+  /*    class  :: A pointer to a class describing the extension.           */
+  /*                                                                       */
+  /* <Return>                                                              */
+  /*    FreeType error code.  0 means success.                             */
+  /*                                                                       */
   EXPORT_FUNC
   FT_Error  FT_Register_Extension( FT_Driver            driver,
-                                   FT_Extension_Class*  clazz )
+                                   FT_Extension_Class*  class )
   {
     FT_Extension_Registry*  registry;
 
+
     registry = (FT_Extension_Registry*)driver->extensions;
-    if (registry)
+    if ( registry )
     {
       FT_Int               n   = registry->num_extensions;
       FT_Extension_Class*  cur = registry->classes + n;
+
       
       if ( n >= FT_MAX_EXTENSIONS )
         return FT_Err_Too_Many_Extensions;
 
-      *cur = *clazz;    
+      *cur = *class;    
 
       cur->offset  = registry->cur_offset;
 
@@ -99,20 +144,40 @@
   }
 
 
-  /* Query an extension block by extension_ID */
-
+  /*************************************************************************/
+  /*                                                                       */
+  /* <Function>                                                            */
+  /*    FT_Get_Extension                                                   */
+  /*                                                                       */
+  /* <Description>                                                         */
+  /*    Queries an extension block by an extension ID string.              */
+  /*                                                                       */
+  /* <Input>                                                               */
+  /*    face                :: A handle to the face object.                */
+  /*    extension_id        :: An ID string identifying the extension.     */
+  /*                                                                       */
+  /* <Output>                                                              */
+  /*    extension_interface :: A generic pointer, usually pointing to a    */
+  /*                           table of functions implementing the         */
+  /*                           extension interface.                        */
+  /*                                                                       */
+  /* <Return>                                                              */
+  /*    A pointer to the extension block.                                  */
+  /*                                                                       */
   EXPORT_FUNC
   void*  FT_Get_Extension( FT_Face      face,
                            const char*  extension_id,
                            void*       *extension_interface ) 
   {
     FT_Extension_Registry*  registry;
+
     
     registry = (FT_Extension_Registry*)face->driver->extensions;
-    if (registry && face->extensions)
+    if ( registry && face->extensions )
     {
       FT_Extension_Class*  cur   = registry->classes;
       FT_Extension_Class*  limit = cur + registry->num_extensions;
+
       
       for ( ; cur < limit; cur++ )
         if ( strcmp( cur->id, extension_id ) == 0 )
@@ -123,55 +188,92 @@
     }
     
     /* could not find the extension id */
+
     *extension_interface = 0;
     return 0;
   }
 
-  /* Destroy all extensions within a face object.  Called by the */
-  /* face object destructor.                                     */
 
+  /*************************************************************************/
+  /*                                                                       */
+  /* <Function>                                                            */
+  /*    FT_Destroy_Extensions                                              */
+  /*                                                                       */
+  /* <Description>                                                         */
+  /*    Destroys all extensions within a face object.                      */
+  /*                                                                       */
+  /* <InOut>                                                               */
+  /*    face :: A handle to the face object.                               */
+  /*                                                                       */
+  /* <Return>                                                              */
+  /*    FreeType error code.  0 means success.                             */
+  /*                                                                       */
+  /* <Note>                                                                */
+  /*    Called by the face object destructor.                              */
+  /*                                                                       */
   LOCAL_FUNC
   FT_Error  FT_Destroy_Extensions( FT_Face  face )
   {
     FT_Extension_Registry*  registry;
     FT_Memory               memory;
-    
+
+ 
     registry = (FT_Extension_Registry*)face->driver->extensions;
-    if (registry && face->extensions)
+    if ( registry && face->extensions )
     {
       FT_Extension_Class*  cur   = registry->classes;
       FT_Extension_Class*  limit = cur + registry->num_extensions;
+
       
       for ( ; cur < limit; cur++ )
       {
         char*  ext = (char*)face->extensions + cur->offset;
         
-        if (cur->finalize)
+        if ( cur->finalize )
           cur->finalize( ext, face );
       }
       
       memory = face->driver->memory;
       FREE( face->extensions );
     }
+
     return FT_Err_Ok;
   }
 
 
-  /* Create an extension within a face object.  Called by the */
-  /* face object constructor.                                 */
-
+  /*************************************************************************/
+  /*                                                                       */
+  /* <Function>                                                            */
+  /*    FT_Create_Extensions                                               */
+  /*                                                                       */
+  /* <Description>                                                         */
+  /*    Creates an extension object within a face object for all           */
+  /*    registered extensions.                                             */
+  /*                                                                       */
+  /* <InOut>                                                               */
+  /*    face :: A handle to the face object.                               */
+  /*                                                                       */
+  /* <Return>                                                              */
+  /*    FreeType error code.  0 means success.                             */
+  /*                                                                       */
+  /* <Note>                                                                */
+  /*    Called by the face object constructor.                             */
+  /*                                                                       */
   LOCAL_FUNC
   FT_Error  FT_Create_Extensions( FT_Face  face )
   {
     FT_Extension_Registry*  registry;
     FT_Memory               memory;
     FT_Error                error;
+
     
     face->extensions = 0;
     
-    /* load extensions registry, exit succesfully if none is there */
+    /* load extensions registry, exit successfully if none is there */
+
     registry = (FT_Extension_Registry*)face->driver->extensions;
-    if (!registry) return FT_Err_Ok;
+    if ( !registry )
+      return FT_Err_Ok;
     
     memory = face->driver->memory;
     if ( ALLOC( face->extensions, registry->cur_offset ) )
@@ -180,18 +282,21 @@
     {
       FT_Extension_Class*  cur   = registry->classes;
       FT_Extension_Class*  limit = cur + registry->num_extensions;
+
       
       for ( ; cur < limit; cur++ )
       {
         char*  ext = (char*)face->extensions + cur->offset;
         
-        if (cur->init)
+        if ( cur->init )
         {
           error = cur->init( ext, face );
-          if (error) break;
+          if ( error )
+            break;
         }
       }
     }
+
     return error;
   }
 
diff --git a/src/base/ftextend.h b/src/base/ftextend.h
index b62a5cf..b3e0c54 100644
--- a/src/base/ftextend.h
+++ b/src/base/ftextend.h
@@ -1,117 +1,114 @@
-/*******************************************************************
- *
- *  ftextend.h                                                   2.0
- *
- *    Extensions Interface.
- *
- *  Copyright 1996-1999 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.
- *
- ******************************************************************/
+/***************************************************************************/
+/*                                                                         */
+/*  ftextend.h                                                             */
+/*                                                                         */
+/*  FreeType extensions implementation (specification).                    */
+/*                                                                         */
+/*  Copyright 1996-2000 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 FTEXTEND_H
 #define FTEXTEND_H
 
-#include "ftconfig.h"
-#include "ftobjs.h"
+#include <ftconfig.h>
+#include <ftobjs.h>
 
 
 #ifdef __cplusplus
   extern "C" {
 #endif
 
-  /* The extensions don't need to be integrated at compile time into */
-  /* the engine, only at link time.                                  */
-
- /*****************************************************************
-  *
-  * <FuncType>
-  *   FT_Extension_Initializer
-  *
-  * <Description>
-  *   Each new face object can have several extensions associated
-  *   to it at creation time. This function is used to initialize
-  *   a given extension data for a given face.
-  *
-  * <Input>
-  *   ext   :: a typeless pointer to the extension data.
-  *   face  :: handle to the source face object the extension is
-  *            associated with
-  *
-  * <Return>
-  *   Error condition. 0 means success
-  *
-  * <Note>
-  *   In case of error, the initializer should not destroy the
-  *   extension data, as the finalizer will get called later
-  *   by the function's caller..
-  *
-  *****************************************************************/
-
+  /*************************************************************************/
+  /*                                                                       */
+  /* The extensions don't need to be integrated at compile time into the   */
+  /* engine, only at link time.                                            */
+  /*                                                                       */
+  /*************************************************************************/
+
+  /*************************************************************************/
+  /*                                                                       */
+  /* <FuncType>                                                            */
+  /*    FT_Extension_Initializer                                           */
+  /*                                                                       */
+  /* <Description>                                                         */
+  /*    Each new face object can have several extensions associated with   */
+  /*    it at creation time.  This function is used to initialize given    */
+  /*    extension data for a given face.                                   */
+  /*                                                                       */
+  /* <InOut>                                                               */
+  /*    ext  :: A typeless pointer to the extension data.                  */
+  /*    face :: A handle to the source face object the extension is        */
+  /*            associated with.                                           */
+  /*                                                                       */
+  /* <Return>                                                              */
+  /*    FreeType error code.  0 means success.                             */
+  /*                                                                       */
+  /* <Note>                                                                */
+  /*    In case of error, the initializer should not destroy the extension */
+  /*    data, as the finalizer will get called later by the function's     */
+  /*    caller.                                                            */
+  /*                                                                       */
   typedef FT_Error (*FT_Extension_Initializer)( void*    ext, 
                                                 FT_Face  face );
 
- /*****************************************************************
-  *
-  * <FuncType>
-  *   FT_Extension_Finalizer
-  *
-  * <Description>
-  *   Each new face object can have several extensions associated
-  *   to it at creation time. This function is used to finalize
-  *   a given extension data for a given face. This occurs before
-  *   the face object itself is finalized.
-  *
-  * <Input>
-  *   ext   :: a typeless pointer to the extension data.
-  *   face  :: handle to the source face object the extension is
-  *            associated with
-  *
-  *****************************************************************/
-
-  typedef void  (*FT_Extension_Finalizer)( void*  ext, FT_Face  face );
-
-
- /*****************************************************************
-  *
-  * <Struct>
-  *   FT_Extension_Class
-  *
-  * <Description>
-  *   A simple structure used to describe a given extension to
-  *   the FreeType base layer. An FT_Extension_Class is used as
-  *   a parameter for FT_Register_Extension.
-  *
-  * <Fields>
-  *   id        :: the extension's id. This is a normal C string
-  *                that is used to uniquely reference the extension's
-  *                interface.
-  *
-  *   size      :: the size in bytes of the extension data that must
-  *                be associated with each face object.
-  *
-  *   init      :: a pointer to the extension data's initializer
-  *   finalize  :: a pointer to the extension data's finalizer
-  *
-  *   inteface  :: this pointer can be anything, but should usually
-  *                point to a table of function pointers which implement
-  *                the extension's interface.
-  *
-  *   offset    :: this field is set and used within the base layer
-  *                and should be set to 0 when registering an
-  *                extension through FT_Register_Extension. It contains
-  *                an offset within the face's extension block for the
-  *                current extension's data.
-  *
-  *****************************************************************/
-
-  typedef struct FT_Extension_Class_
+
+  /*************************************************************************/
+  /*                                                                       */
+  /* <FuncType>                                                            */
+  /*    FT_Extension_Finalizer                                             */
+  /*                                                                       */
+  /* <Description>                                                         */
+  /*    Each new face object can have several extensions associated with   */
+  /*    it at creation time.  This function is used to finalize given      */
+  /*    extension data for a given face; it occurs before the face object  */
+  /*    itself is finalized.                                               */
+  /*                                                                       */
+  /* <InOut>                                                               */
+  /*   ext  :: A typeless pointer to the extension data.                   */
+  /*   face :: A handle to the source face object the extension is         */
+  /*           associated with.                                            */
+  /*                                                                       */
+  typedef void  (*FT_Extension_Finalizer)( void*    ext,
+                                           FT_Face  face );
+
+
+  /*************************************************************************/
+  /*                                                                       */
+  /* <Struct>                                                              */
+  /*    FT_Extension_Class                                                 */
+  /*                                                                       */
+  /* <Description>                                                         */
+  /*    A simple structure used to describe a given extension to the       */
+  /*    FreeType base layer.  An FT_Extension_Class is used as a parameter */
+  /*    for FT_Register_Extension().                                       */
+  /*                                                                       */
+  /* <Fields>                                                              */
+  /*    id        :: The extension's ID.  This is a normal C string that   */
+  /*                 is used to uniquely reference the extension's         */
+  /*                 interface.                                            */
+  /*    size      :: The size in bytes of the extension data that must be  */
+  /*                 associated with each face object.                     */
+  /*    init      :: A pointer to the extension data's initializer.        */
+  /*    finalize  :: A pointer to the extension data's finalizer.          */
+  /*    interface :: This pointer can be anything, but should usually      */
+  /*                 point to a table of function pointers which implement */
+  /*                 the extension's interface.                            */
+  /*                                                                       */
+  /*    offset    :: This field is set and used within the base layer and  */
+  /*                 should be set to 0 when registering an extension      */
+  /*                 through FT_Register_Extension().  It contains an      */
+  /*                 offset within the face's extension block for the      */
+  /*                 current extension's data.                             */
+  /*                                                                       */
+  typedef struct  FT_Extension_Class_
   {
     const char*               id;
     FT_ULong                  size;
@@ -130,6 +127,8 @@
 
 
 #ifdef FT_CONFIG_OPTION_EXTEND_ENGINE
+
+
   /* Initialize the extension component */
   LOCAL_DEF
   FT_Error  FT_Init_Extensions( FT_Library  library );
@@ -147,13 +146,17 @@
   /* face object destructor.                                     */
   LOCAL_DEF
   FT_Error  FT_Destroy_Extensions( FT_Face  face );
+
+
 #endif
 
-  /* Returns an extension's data & inteface according to its ID */
+
+  /* Returns an extension's data & interface according to its ID */
   EXPORT_DEF
   void*     FT_Get_Extension( FT_Face      face,
                               const char*  extension_id,
                               void*       *extension_interface );
+
 #ifdef __cplusplus
   }
 #endif