shithub: freetype+ttf2subf

Download patch

ref: 18b55f7bbc39f92877f825326441c13f8aaf5e80
parent: 4c8815e1a6aaaa7282cbcb0c5fd2c90c2bfe3ec0
author: David Turner <[email protected]>
date: Wed Jan 10 01:53:49 EST 2001

improved the docmaker script

git/fs: mount .git/fs: mount/attach disallowed
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2000-01-09  David Turner <[email protected]>
+
+	* docs/docmaker.py: improved script to generate table of contents and
+	index pages.
+
 2000-01-04  Werner Lemberg  <[email protected]>
 
 	* include/freetype/ttnameid.h: Updated Unicode code range comments.
--- a/docs/docmaker.py
+++ b/docs/docmaker.py
@@ -18,7 +18,6 @@
 <style content="text/css">
   P { text-align=justify }
   H1 { text-align=center }
-  H2 { text-align=center }
   LI { text-align=justify }
 </style>
 </header>
@@ -55,13 +54,20 @@
 para_header = "<p>"
 para_footer = "</p>"
 
-block_header = """<center><hr width="550"><table width="550"><tr><td>"""
-block_footer = "</table></center>"
+block_header = """<center><hr width="750"><table width="750"><tr><td>"""
+block_footer = "</td></tr></table></center>"
 
-source_header = """<center><table width="550"><tr bgcolor="#D6E8FF" width="100%"><td><pre>
+description_header = """<center><table width="650"><tr><td>"""
+description_footer = """</td></tr></table></center><br>"""
+
+marker_header = """<center><table width="650" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>"""
+marker_inter  = "</b></em></td></tr><tr><td>"
+marker_footer = "</td></tr></table></center>"
+
+source_header = """<center><table width="650"><tr bgcolor="#D6E8FF" width="100%"><td><pre>
 """
 source_footer = """</pre></table></center>
-<br><br>
+<br>
 """
 
 
@@ -213,6 +219,7 @@
 #
 # The paragraph is filled line by line by the parser.
 #
+
 class DocParagraph:
 
     def __init__( self ):
@@ -314,6 +321,7 @@
 # pass a list of input text lines in the "lines_list" parameter.
 #
 #
+
 class DocContent:
 
     def __init__( self, lines_list ):
@@ -467,7 +475,7 @@
 
             else:
                 if not in_table:
-                    print "<table cellpadding=4><tr valign=top><td>"
+                    print '<table cellpadding=4><tr valign=top><td>'
                     in_table = 1
                 else:
                     print "</td></tr><tr valign=top><td>"
@@ -481,6 +489,31 @@
             print "</td></tr></table>"
 
 
+    def dump_html_in_table( self ):
+        n        = len( self.items )
+        in_table = 0
+
+        for i in range( n ):
+            item  = self.items[i]
+            field = item[0]
+
+            if not field:
+                if item[1]:
+                    print "<tr><td colspan=2>"
+                    for element in item[1]:
+                        element.dump_html()
+                    print "</td></tr>"
+
+            else:
+                print "<tr><td><b>" + field + "</b></td><td>"
+
+                for element in item[1]:
+                    element.dump_html()
+
+                print "</td></tr>"
+
+
+
 ######################################################################################
 #
 #
@@ -494,14 +527,21 @@
 #   "self.source" is simply a list of text lines taken from the
 #   uncommented source itself.
 #
-#   Finally, "self.identifier" is a simple identifier used to
-#   uniquely identify the block.
+#   Finally, "self.name" is a simple identifier used to
+#   uniquely identify the block. it is taken from the first word of the first
+#   paragraphe of the first marker of a given block, i.e:
 #
+#      <Type> Goo
+#      <Description> Bla bla bla
+#
+#   will have a name of "Goo"
+#
 class DocBlock:
 
     def __init__( self, block_line_list = [], source_line_list = [] ):
-        self.items  = []                 # current ( marker, contents ) list
-        self.identifier = None
+        self.items      = []             # current ( marker, contents ) list
+        self.section    = None           # section this block belongs to
+        
         marker      = None               # current marker
         content     = []                 # current content lines list
         alphanum    = string.letters + string.digits + "_"
@@ -572,8 +612,6 @@
         if l > 0 and marker:
             content = DocContent( lines )
             self.items.append( ( string.lower( marker ), content ) )
-            if not self.identifier:
-                self.identifier = content.get_identifier()
 
     
     def find_content( self, marker ):
@@ -594,14 +632,20 @@
         types = [ 'type', 'struct', 'functype', 'function', 'constant',
                   'enum', 'macro' ]
 
+        parameters = [ 'input', 'inout', 'output', 'return' ]
+
         if not self.items:
             return
 
+        # place html anchor when needed
+        if self.name:
+            print '<a name="'+self.name+'">'
+
         # start of a block
         #
         print block_header
 
-        print "<h2>" + self.identifier + "</h2>"
+        print "<h4>" + self.name + "</h4>"
 
         # print source code
         #
@@ -617,6 +661,8 @@
             print  line
         print source_footer
 
+        in_table = 0
+        
         # dump each (marker,content) element
         #
         for element in self.items:
@@ -624,17 +670,19 @@
             content = element[1]
 
             if marker == "description":
-                print "<ul>"
+                print description_header
                 content.dump_html()
-                print "</ul>"
+                print description_footer
 
             elif not ( marker in types ):
-                print "<h4>" + marker + "</h4>"
-                print "<ul>"
+
+                print marker_header
+                print marker
+                print marker_inter
                 content.dump_html()
-                print "</ul>"
-
-            print ""
+                print marker_footer
+                
+        print ""
 
         print block_footer
 
@@ -649,6 +697,8 @@
 #
 #   <Section> Basic_Data_Types
 #
+#   <Title> FreeType 2 Basic Data Types
+#
 #   <Abstract>
 #      Definitions of basic FreeType data types
 #
@@ -663,11 +713,6 @@
         self.name        = string.lower( block.name )
         self.abstract    = block.find_content( "abstract" )
         self.description = block.find_content( "description" )
-        title_content    = block.find_content( "title" )
-        if title_content:
-            self.title   = title_content.get_title()
-        else:
-            self.titles  = "UNKNOWN_SECTION_TITLE!"
         self.elements    = {}
         self.list        = []
         self.filename    = self.name + ".html"
@@ -722,6 +767,7 @@
         self.sections        = {}
         self.list            = []
         self.current_section = None
+        self.index           = []    # sorted list of blocks that are not sections
 
 
     def append_section( self, block ):
@@ -748,6 +794,7 @@
                 #
                 section.abstract    = abstract
                 section.description = block.find_content( "description" )
+                section.block       = block
 
         else:
             # a new section
@@ -755,7 +802,7 @@
             section = DocSection( block )
             self.sections[name] = section
             self.list.append( section )
-
+            
         self.current_section = section
 
 
@@ -768,11 +815,44 @@
             elif self.current_section:
                 # sys.stderr.write( "  new block" )
                 self.current_section.add_element( block )
+                block.section = self.current_section
+                self.index.append( block )
 
 
+    def prepare_files( self, file_prefix = None ):
+        # prepare the section list, by computing section filenames
+        # and the index
+        if file_prefix:
+            prefix = file_prefix + "-"
+        else:
+            prefix = ""
+
+        # compute section names
+        for section in self.sections.values():
+            title_content     = section.block.find_content( "title" )
+            if title_content:
+                section.title = title_content.get_title()
+            else:
+                section.title = "UNKNOWN_SECTION_TITLE!"
+
+        # compute section filenames        
+        for section in self.sections.values():
+            section.filename = prefix + section.name + ".html"
+
+        self.toc_filename   = prefix + "toc.html"
+        self.index_filename = prefix + "index.html"
+
+        # compute the sorted block list for the index
+        self.index.sort( block_lexicographical_compare )
+        
+
     def dump_html_toc( self ):
         # dump an html table of contents
         #
+        old_stdout = sys.stdout
+        new_file   = open( self.toc_filename, "w" )
+        sys.stdout = new_file
+        
         print html_header
 
         print "<center><h1>Table of Contents</h1></center>"
@@ -790,24 +870,64 @@
 
         print html_footer
 
+        sys.stdout = old_stdout
 
+
     def dump_html_sections( self ):
         old_stdout = sys.stdout
+
         for section in self.sections.values():
-            new_file   = open( section.filename, "w" )
-            sys.stdout = new_file
-            section.dump_html()
-            new_file.close()
+            
+            if section.filename:
+                new_file   = open( section.filename, "w" )
+                sys.stdout = new_file
+                section.dump_html()
+                new_file.close()
 
         sys.stdout = old_stdout
 
 
+    def dump_html_index( self ):
+        
+        old_stdout = sys.stdout
+        new_file   = open( self.index_filename, "w" )
+        sys.stdout = new_file
 
+        num_columns = 3
+        total       = len( self.index )
+        line        = 0
+
+        print html_header
+
+        print "<center><h1>General Index</h1></center>"
+
+        print "<center><table cellpadding=5><tr valign=top><td>"
+
+        for block in self.index:
+
+            print '<a href="'+block.section.filename+'#'+block.name+'">'
+            print block.name
+            print "</a><br>"
+
+            if line*num_columns >= total:
+                print "</td><td>"
+                line = 0
+            else:
+                line = line+1
+
+        print "</tr></table></center>"
+
+        print html_footer
+        
+        sys.stdout = old_stdout
+        
+
 # Filter a given list of DocBlocks. Returns a new list
 # of DocBlock objects that only contains element whose
 # "type" (i.e. first marker) is in the "types" parameter.
 #
-def filter_blocks( block_list, types ):
+def filter_blocks_by_type( block_list, types ):
+
     new_list = []
     for block in block_list:
         if block.items:
@@ -819,17 +939,21 @@
     return new_list
 
 
+def filter_section_blocks( block ):
+    return block.section != None
+
+
 # Perform a lexicographical comparison of two DocBlock
 # objects. Returns -1, 0 or 1.
 #
 def block_lexicographical_compare( b1, b2 ):
-    if not b1.identifier:
+    if not b1.name:
         return -1
-    if not b2.identifier:
+    if not b2.name:
         return 1
 
-    id1 = string.lower( b1.identifier )
-    id2 = string.lower( b2.identifier )
+    id1 = string.lower( b1.name )
+    id2 = string.lower( b2.name )
 
     if id1 < id2:
         return -1
@@ -839,16 +963,7 @@
         return 1
 
 
-def block_make_list( source_block_list ):
-    list = []
 
-    for block in source_block_list:
-        docblock = DocBlock( block[0], block[1] )
-        list.append( docblock )
-
-    return list
-
-
 # dump a list block as a single HTML page
 #
 def dump_html_1( block_list ):
@@ -862,7 +977,7 @@
 
 
 
-def make_block_list():
+def make_block_list_inner():
     """parse a file and extract comments blocks from it"""
 
     list   = []
@@ -1013,6 +1128,21 @@
     return list
 
 
+# create a list of DocBlock elements
+#
+def make_block_list():
+    
+    source_block_list = make_block_list_inner()
+    list              = []
+
+    for block in source_block_list:
+        docblock = DocBlock( block[0], block[1] )
+        list.append( docblock )
+
+    return list
+
+
+
 # This function is only used for debugging
 #
 def dump_block_list( list ):
@@ -1029,17 +1159,26 @@
 
 def main( argv ):
     """main program loop"""
+
+    # we begin by simply building a list of DocBlock elements
+    #
     sys.stderr.write( "extracting comment blocks from sources...\n" )
     list = make_block_list()
-    list = block_make_list(list)
 
+    # now, sort the blocks into sections
+    #
     section_list = DocSectionList()
     for block in list:
         section_list.append_block( block )
 
+    section_list.prepare_files( "ft2" )
+
+    # dump the section list TOC and sections
+    #
     section_list.dump_html_toc()
     section_list.dump_html_sections()
-
+    section_list.dump_html_index()
+    
     # list2 = filter_blocks( list, ['type','macro','enum','constant', 'functype'] )
     # list2 = list
     # list2.sort( block_lexicographical_compare )
--- a/include/freetype/freetype.h
+++ b/include/freetype/freetype.h
@@ -55,6 +55,18 @@
   /*************************************************************************/
   /*************************************************************************/
 
+  /*************************************************************************
+   *
+   * <Section> Base_Interface
+   *
+   * <Title> Base Interface
+   *
+   * <Abstract>
+   *    The FreeType 2 base font interface
+   *
+   * <Description>
+   *    This sections details the public high-level API of FreeType 2
+   */
 
   /*************************************************************************/
   /*                                                                       */
@@ -97,59 +109,6 @@
     FT_Pos  vertAdvance;   /* advance height for vertical layout    */
 
   } FT_Glyph_Metrics;
-
-
-  /*************************************************************************/
-  /*                                                                       */
-  /* <FuncType>                                                            */
-  /*    FT_Generic_Finalizer                                               */
-  /*                                                                       */
-  /* <Description>                                                         */
-  /*    Describes a function used to destroy the `client' data of any      */
-  /*    FreeType object.  See the description of the FT_Generic type for   */
-  /*    details of usage.                                                  */
-  /*                                                                       */
-  /* <Input>                                                               */
-  /*    The address of the FreeType object which is under finalization.    */
-  /*    Its client data is accessed through its `generic' field.           */
-  /*                                                                       */
-  typedef void  (*FT_Generic_Finalizer)(void*  object);
-
-
-  /*************************************************************************/
-  /*                                                                       */
-  /* <Struct>                                                              */
-  /*    FT_Generic                                                         */
-  /*                                                                       */
-  /* <Description>                                                         */
-  /*    Client applications often need to associate their own data to a    */
-  /*    variety of FreeType core objects.  For example, a text layout API  */
-  /*    might want to associate a glyph cache to a given size object.      */
-  /*                                                                       */
-  /*    Most FreeType object contains a `generic' field, of type           */
-  /*    FT_Generic, which usage is left to client applications and font    */
-  /*    servers.                                                           */
-  /*                                                                       */
-  /*    It can be used to store a pointer to client-specific data, as well */
-  /*    as the address of a `finalizer' function, which will be called by  */
-  /*    FreeType when the object is destroyed (for example, the previous   */
-  /*    client example would put the address of the glyph cache destructor */
-  /*    in the `finalizer' field).                                         */
-  /*                                                                       */
-  /* <Fields>                                                              */
-  /*    data      :: A typeless pointer to any client-specified data. This */
-  /*                 field is completely ignored by the FreeType library.  */
-  /*                                                                       */
-  /*    finalizer :: A pointer to a `generic finalizer' function, which    */
-  /*                 will be called when the object is destroyed.  If this */
-  /*                 field is set to NULL, no code will be called.         */
-  /*                                                                       */
-  typedef struct  FT_Generic_
-  {
-    void*                 data;
-    FT_Generic_Finalizer  finalizer;
-
-  } FT_Generic;
 
 
   /*************************************************************************/
--- a/include/freetype/ftimage.h
+++ b/include/freetype/ftimage.h
@@ -33,6 +33,11 @@
 
 FT_BEGIN_HEADER
 
+  /***********************************************************************
+   *
+   * <Section> Basic_Types
+   *
+   */
 
   /*************************************************************************/
   /*                                                                       */
@@ -226,6 +231,12 @@
   } FT_Bitmap;
 
 
+  /***********************************************************************
+   *
+   * <Section> outline_processing
+   *
+   */
+
   /*************************************************************************/
   /*                                                                       */
   /* <Struct>                                                              */
@@ -346,7 +357,8 @@
 
   } FT_Outline_Flags;
 
-
+  /* */
+  
 #define FT_CURVE_TAG( flag )  ( flag & 3 )
 
 #define FT_Curve_Tag_On           1
@@ -516,6 +528,12 @@
   } FT_Outline_Funcs;
 
 
+  /***********************************************************************
+   *
+   * <Section> Basic_Types
+   *
+   */
+
   /*************************************************************************/
   /*                                                                       */
   /* <Macro>                                                               */
@@ -594,6 +612,18 @@
   /*                                                                       */
   /*************************************************************************/
 
+  /************************************************************************
+   *
+   *  <Section> Raster
+   *
+   *  <Title> Scanline converter
+   *
+   *  <Abstract>
+   *     How vectorial outlines are converted into bitmaps and pixmaps
+   *
+   *  <Description>
+   *     This section contains technical definitions
+   */
 
   /*************************************************************************/
   /*                                                                       */
--- a/include/freetype/ftlist.h
+++ b/include/freetype/ftlist.h
@@ -34,7 +34,21 @@
 
 FT_BEGIN_HEADER
 
-
+  /**************************************************************************
+   *
+   *  <Section> list_processing
+   *
+   *  <Title> List Processing
+   *
+   *  <Abstract>
+   *     simple management of lists
+   *
+   *  <Description>
+   *     This section contains various definitions related to list processing
+   *     using doubly-linked nodes.
+   *
+   */
+  
   /*************************************************************************/
   /*                                                                       */
   /* <Function>                                                            */
@@ -213,7 +227,8 @@
                                        FT_Memory           memory,
                                        void*               user );
 
-
+  /* */
+  
 FT_END_HEADER
 
 #endif /* __FTLIST_H__ */
--- a/include/freetype/ftoutln.h
+++ b/include/freetype/ftoutln.h
@@ -27,6 +27,21 @@
 
 FT_BEGIN_HEADER
 
+  /*************************************************************************/
+  /*                                                                       */
+  /* <Section> outline_processing                                          */
+  /*                                                                       */
+  /* <Title> Outline Processing                                            */
+  /*                                                                       */
+  /* <Abstract>                                                            */
+  /*    Functions to create, transform and render vectorial glyph images   */
+  /*                                                                       */
+  /* <Description>                                                         */
+  /*    This sections contains routines used to create and destroy         */
+  /*    scalable glyph images known as "outlines". These can also be       */
+  /*    measured, transformed and converted into bitmaps, pixmaps and      */
+  /*                                                                       */
+  /*                                                                       */
 
   /*************************************************************************/
   /*                                                                       */
--- a/include/freetype/ftsystem.h
+++ b/include/freetype/ftsystem.h
@@ -25,6 +25,22 @@
 
 FT_BEGIN_HEADER
 
+  /**************************************************************************
+   *
+   *  <Section> system_interface
+   *
+   *  <Title> System Interface
+   *
+   *  <Abstract>
+   *     How FreeType manages memory and i/o
+   *
+   *  <Description>
+   *     This section contains various definitions related to memory
+   *     management and i/o access. You'll need to understand this
+   *     information if you want to use a custom memory manager or
+   *     you own input i/o streams
+   *
+   */
 
   /*************************************************************************/
   /*                                                                       */
@@ -32,16 +48,68 @@
   /*                                                                       */
   /*************************************************************************/
 
-
+ /**********************************************************************
+  *
+  * @type: FT_Memory
+  *
+  * @description:
+  *   a handle to a given memory manager object, defined with a
+  *   @FT_MemoryRec structure.
+  */
   typedef struct FT_MemoryRec_*  FT_Memory;
 
 
+ /**********************************************************************
+  *
+  * @functype: FT_Alloc_Func
+  *
+  * @description:
+  *   a function used to allocate "size" bytes from "memory"
+  *
+  * @input:
+  *   memory :: handle to source memory manager
+  *   size   :: size in bytes to allocate
+  *
+  * @return:
+  *   address of new memory block. 0 in case of failure
+  */
   typedef void*  (*FT_Alloc_Func)( FT_Memory  memory,
                                    long       size );
 
+
+ /**********************************************************************
+  *
+  * @functype: FT_Free_Func
+  *
+  * @description:
+  *   a function used to release a given block of memory
+  *
+  * @input:
+  *   memory :: handle to source memory manager
+  *   block  :: address of target memory block
+  */
   typedef void   (*FT_Free_Func)( FT_Memory  memory,
                                   void*      block );
 
+ /**********************************************************************
+  *
+  * @functype: FT_Realloc_Func
+  *
+  * @description:
+  *   a function used to re-allocate a given block of memory
+  *
+  * @input:
+  *   memory   :: handle to source memory manager
+  *   cur_size :: the block's current size in bytes
+  *   new_size :: the block's requested new size
+  *   block    :: the block's current address
+  *
+  * @return:
+  *   new block address. 0 in case of memory shortage.
+  *
+  * @note:
+  *   note that in case of error, the old block must still be available
+  */
   typedef void*  (*FT_Realloc_Func)( FT_Memory  memory,
                                      long       cur_size,
                                      long       new_size,
@@ -48,6 +116,20 @@
                                      void*      block );
 
 
+ /**********************************************************************
+  *
+  * @struct: FT_MemoryRec
+  *
+  * @description:
+  *   a structure used to describe a given memory manager to FreeType 2
+  *
+  * @fields:
+  *    user    ::
+  *    alloc   :: 
+  *    free    ::
+  *    realloc ::
+  *
+  */
   struct FT_MemoryRec_
   {
     void*            user;
@@ -64,6 +146,26 @@
   /*************************************************************************/
 
 
+ /************************************************************************
+  *
+  * @type: FT_Stream
+  *
+  * @description:
+  *   a handle to an input stream.
+  */
+  typedef struct FT_StreamRec_*  FT_Stream;
+
+
+
+ /************************************************************************
+  *
+  * @struct: FT_StreamDesc
+  *
+  * @description:
+  *   a union type used to store either a long or a pointer. This is
+  *   used to store a file descriptor or a FILE* in an input stream
+  *
+  */
   typedef union  FT_StreamDesc_
   {
     long   value;
@@ -72,17 +174,80 @@
   } FT_StreamDesc;
 
 
-  typedef struct FT_StreamRec_*  FT_Stream;
-
-
+ /************************************************************************
+  *
+  * @functype: FT_Stream_IO
+  *
+  * @description:
+  *   a function used to seek and read data from a given input stream
+  *
+  * @input:
+  *   stream :: handle to source stream
+  *   offset :: offset of read in stream (always from start)
+  *   buffer :: address of read buffer
+  *   count  :: number of bytes to read from the stream
+  *
+  * @return:
+  *   number of bytes effectively read by the stream
+  *
+  * @note:
+  *   this function might be called to perform seek / skip with
+  *   a "count" of 0
+  */
   typedef unsigned long  (*FT_Stream_IO)( FT_Stream       stream,
                                           unsigned long   offset,
                                           unsigned char*  buffer,
                                           unsigned long   count );
 
+ /************************************************************************
+  *
+  * @functype: FT_Stream_Close
+  *
+  * @description:
+  *   a function used to close a given input stream
+  *
+  * @input:
+  *   stream :: handle to target stream
+  */
   typedef void  (*FT_Stream_Close)( FT_Stream  stream );
 
 
+ /************************************************************************
+  *
+  * @struct: FT_StreamRec
+  *
+  * @description:
+  *   a structure used to describe an input stream
+  *
+  * @input:
+  *   base       :: for memory-based stream, this is the address of the first
+  *                 stream byte in memory. this field should always be set to
+  *                 NULL for disk-based streams.
+  *
+  *   size       :: the stream size in bytes
+  *   pos        :: the current position within the stream
+  *
+  *   descriptor :: this field is a union that can hold an integer or a pointer
+  *                 it is used by stream implementations to store file
+  *                 descriptors or FILE* pointers..
+  *
+  *   pathname   :: this field is completely ignored by FreeType, however,
+  *                 it's often useful during debugging to use it to store
+  *                 the stream's filename, where available
+  *
+  *   read       :: the stream's input function
+  *   close      :: the stream close function
+  *
+  *   memory     :: memory manager to use to preload frames. this is set
+  *                 internally by FreeType and shouldn't be touched by
+  *                 stream implementations
+  *
+  *   cursor     :: this field is set and used internally by FreeType
+  *                 when parsing frames.
+  *
+  *   limit      :: this field is set and used internally by FreeType
+  *                 when parsing frames.
+  */
   struct  FT_StreamRec_
   {
     unsigned char*   base;
@@ -90,8 +255,7 @@
     unsigned long    pos;
 
     FT_StreamDesc    descriptor;
-    FT_StreamDesc    pathname;    /* ignored by FreeType -- */
-                                  /* useful for debugging   */
+    FT_StreamDesc    pathname;
     FT_Stream_IO     read;
     FT_Stream_Close  close;
 
@@ -100,6 +264,7 @@
     unsigned char*   limit;
   };
 
+  /* */
 
 FT_END_HEADER
 
--- a/include/freetype/fttypes.h
+++ b/include/freetype/fttypes.h
@@ -29,6 +29,19 @@
 
 FT_BEGIN_HEADER
 
+  /*************************************************************************/
+  /*                                                                       */
+  /* <Section> Basic_Types                                                 */
+  /*                                                                       */
+  /* <Title> Basic Data Types                                              */
+  /*                                                                       */
+  /* <Abstract>                                                            */
+  /*    The basic data types defined by the library                        */
+  /*                                                                       */
+  /* <Description>                                                         */
+  /*    This sections contains the basic data types defined by FreeType 2, */
+  /*    rangine from simple scalar types to font specific ones             */
+  /*                                                                       */
 
   /*************************************************************************/
   /*                                                                       */
@@ -277,6 +290,60 @@
 
   /*************************************************************************/
   /*                                                                       */
+  /* <FuncType>                                                            */
+  /*    FT_Generic_Finalizer                                               */
+  /*                                                                       */
+  /* <Description>                                                         */
+  /*    Describes a function used to destroy the `client' data of any      */
+  /*    FreeType object.  See the description of the FT_Generic type for   */
+  /*    details of usage.                                                  */
+  /*                                                                       */
+  /* <Input>                                                               */
+  /*    The address of the FreeType object which is under finalization.    */
+  /*    Its client data is accessed through its `generic' field.           */
+  /*                                                                       */
+  typedef void  (*FT_Generic_Finalizer)(void*  object);
+
+
+  /*************************************************************************/
+  /*                                                                       */
+  /* <Struct>                                                              */
+  /*    FT_Generic                                                         */
+  /*                                                                       */
+  /* <Description>                                                         */
+  /*    Client applications often need to associate their own data to a    */
+  /*    variety of FreeType core objects.  For example, a text layout API  */
+  /*    might want to associate a glyph cache to a given size object.      */
+  /*                                                                       */
+  /*    Most FreeType object contains a `generic' field, of type           */
+  /*    FT_Generic, which usage is left to client applications and font    */
+  /*    servers.                                                           */
+  /*                                                                       */
+  /*    It can be used to store a pointer to client-specific data, as well */
+  /*    as the address of a `finalizer' function, which will be called by  */
+  /*    FreeType when the object is destroyed (for example, the previous   */
+  /*    client example would put the address of the glyph cache destructor */
+  /*    in the `finalizer' field).                                         */
+  /*                                                                       */
+  /* <Fields>                                                              */
+  /*    data      :: A typeless pointer to any client-specified data. This */
+  /*                 field is completely ignored by the FreeType library.  */
+  /*                                                                       */
+  /*    finalizer :: A pointer to a `generic finalizer' function, which    */
+  /*                 will be called when the object is destroyed.  If this */
+  /*                 field is set to NULL, no code will be called.         */
+  /*                                                                       */
+  typedef struct  FT_Generic_
+  {
+    void*                 data;
+    FT_Generic_Finalizer  finalizer;
+
+  } FT_Generic;
+
+
+
+  /*************************************************************************/
+  /*                                                                       */
   /* <Macro>                                                               */
   /*    FT_MAKE_TAG                                                        */
   /*                                                                       */
@@ -299,6 +366,10 @@
   /*************************************************************************/
   /*************************************************************************/
 
+  /**************************************************************************
+   *
+   *  <Section> list_processing
+   */
 
   /*************************************************************************/
   /*                                                                       */
--- a/include/freetype/tttables.h
+++ b/include/freetype/tttables.h
@@ -27,6 +27,19 @@
 
 FT_BEGIN_HEADER
 
+  /*************************************************************************/
+  /*                                                                       */
+  /* <Section> TrueType_Tables                                             */
+  /*                                                                       */
+  /* <Title> TrueType Tables                                               */
+  /*                                                                       */
+  /* <Abstract>                                                            */
+  /*    TrueType-specific table types and functions                        */
+  /*                                                                       */
+  /* <Description>                                                         */
+  /*    This sections contains the definition of TrueType-specific tables  */
+  /*    as well as some routines used to access and process them.          */
+  /*                                                                       */
 
   /*************************************************************************/
   /*                                                                       */
@@ -520,6 +533,8 @@
   } TT_MaxProfile;
 
 
+  /* */
+
   typedef enum
   {
     ft_sfnt_head = 0,
@@ -568,6 +583,8 @@
   FT_EXPORT( void* )  FT_Get_Sfnt_Table( FT_Face      face,
                                          FT_Sfnt_Tag  tag );
 
+
+  /* */
 
 FT_END_HEADER