*** DISCLAIMER : The information contained in this file is ************
********         severely outdated.						   ************

                        The FreeType Project

                       Resident Tables Layout

                          by David Turner


A. Introduction :

This files contains the current layout of the resident tables used
by the FreeType engine.


B. Design :

A Resident table will contain some important data loaded from the
font file (like the table directory, character mappings, glyph
locations). It can be seen as a group of adjacent segments, the
first of them being called the 'leading' segment.  Note that the
size of each segment is set at load time, and cannot be changed
before the table is discarded.

Because the FreeType project will probably come with a very simple
garbage collector, a resident table may be relocated at runtime.
This implies that all pointers should be located in the leading
segment.  A relocation will invoke a function called
'Relocate_Resident_Table' that will be in charge of recomputing the
values of the pointers according to the font file's specifics
(usually the values found in the MaxProfile table are enough to do
that).

If you intend to add new segments to the resident table, please
change this file to reflect your modifications, as well as the
relocation function found in the tables component (tttables.c and
tttables.pas).

NOTE : RELOCATION FUNCTION HAS NOT BEEN WRITTEN YET

C. LayOut

Note that an '*' indicates a pointer to a structure containing other
pointers.

1. Leading Segment

    totalSize      : LongInt          Size in bytes of the Resident
                                      Table.
    numTables      : Int              Number of TrueType tables
    dirTables      : PTableDirEntries Table directory entries array
  
    numCMaps       : Int              Number of character mapping tables
  * cMaps          : PCMapTables      CMap Tables array
  
    maxProfile     : TMaxProfile      Maximum Profile table (record)
    fontHeader     : TFontHeader      Font Header (record)
  
    numGlyphs      : Int              Number of glyphs.

    numLocations   : Int              Number of glyph locations
                                      ( can be > numGlyphs )

    glyphLocations :  PStorage        Array of offsets in the 
                                      glyf table

    horizontalHeader : THorizontalHeader  Horizontal header and
    LongHMetrics     : PTableHorMetrics   metrics tables.
    ShortHMetrics    : PShort

    fontPgmSize    : Int              Size of Font Program in bytes
    fontProgram    : PByte            Pointer to Font Program
  
    cvtPgmSize     : Int              Size of CVT Program in bytes
    cvtProgram     : PByte            Pointer to Font Program

    cvtSize        : Int              Size of default CVT in shorts
    cvt            : PShort           default cvt table
  

2. Instance data :

  too be continued ...

