home *** CD-ROM | disk | FTP | other *** search
/ Columbia Kermit / kermit.zip / archives / ckc197.tar.gz / ckc197.tar / ckmmft.r < prev    next >
Text File  |  2000-01-02  |  8KB  |  217 lines

  1. /*----------------------------FOND Ç Font Family Description----------------------------*/
  2. /* Note: this FOND resource definition only works when the tables at the end of the
  3.          resource are in this order:    1 - Family Character-Width Table
  4.                                          2 - Style Mapping Table
  5.                                         3 - Kerning Tables
  6. */
  7. type 'FOND' {
  8.         /* Flags Word */
  9.         boolean        proportionalFont, fixedWidthFont;
  10.         boolean        useFractWidthTable, dontUseFractWidthTable;
  11.         boolean        computeFixedPointExtra, useIntegerExtra;
  12.         boolean        useFractEnable, ignoreFractEnable;
  13.         boolean        canAdjustCharSpacing, dontAdjustCharSpacing;
  14.         unsigned hex bitstring[9] = 0;                            /* Reserved                */
  15.         boolean        noCharWidthTable, hasCharWidthTable;
  16.         boolean        noImageHeightTable, hasImageHeightTable;
  17.  
  18.         integer;                                                /* Family ID number        */
  19.     First:
  20.         integer;                                                /* first char            */
  21.     Last:
  22.         integer;                                                /* last char            */
  23.         integer;                                                /* Ascent                */
  24.         integer;                                                /* Descent                */
  25.         integer;                                                /* Leading                */
  26.         integer;                                                /* Width Max            */
  27.     WidthOffset:
  28.         unsigned hex longint = WidthTable[1] >> 3;                /* Width table offset    */
  29.     KerningOffset:
  30.         unsigned hex longint = KerningTable[1] >> 3;            /* Kerning table offset    */
  31.     StyleMapOffset:
  32.         unsigned hex longint = StyleTable[1] >> 3;                /* Style map offset        */
  33.         integer;                                                /* reserved                */
  34.         integer;                                                /* ex wid bold            */
  35.         integer;                                                /* ex wid italic        */
  36.         integer;                                                /* ex wid underline        */
  37.         integer;                                                /* ex wid outline        */
  38.         integer;                                                /* ex wid shadow        */
  39.         integer;                                                /* ex wid condensed        */
  40.         integer;                                                /* ex wid extended        */
  41.         integer;                                                /* reserved                */
  42.         longint;                                                /* reserved for intl    */
  43.     Version:
  44.         integer;                                                /* version                */
  45.     
  46.         /* Font Association Table */
  47.         integer = $$CountOf(FontEntries)-1;                     /* # of font entries    */
  48.         wide array FontEntries {
  49.             integer;                                            /* Font size            */
  50.             integer;                                            /* Font style            */
  51.             integer;                                            /* Resource ID of FONT    */
  52.         };
  53.         /*  */
  54.         array [$$Word(Version) == 2] {
  55.     OffsetTableStart:
  56.             integer = $$CountOf(OffsetTable) - 1;
  57.             array OffsetTable {
  58.                 longint = (BBoxStart[1] - OffsetTableStart[1]) >> 3;                
  59.             };
  60.             /* Font Bounding Box Table */
  61.     BBoxStart:
  62.             integer = $$CountOf(BBoxTable) - 1;
  63.             wide array BBoxTable {
  64.                 fill bit[9];                                    /* Reserved                */
  65.                 Boolean        noExtendedStyle, EXTENDEDstyle;        /* Extended style        */
  66.                 Boolean        noCondensedStyle, CONDENSEDstyle;    /* Condensed style        */
  67.                 Boolean        noShadowStyle, SHADOWstyle;            /* Shadow style            */
  68.                 Boolean        noOutlineStyle, OUTLINEstyle;        /* Outline style        */
  69.                 Boolean        noUnderline, UNDERLINEstyle;        /* Underline style        */
  70.                 Boolean        noItalicStyle, ITALICstyle;            /* Italic style            */
  71.                 Boolean        noBoldStyle, BOLDstyle;                /* Bold style            */
  72.                 Rect;
  73.             };
  74.         };
  75.  
  76.         /* Family Character-Width Table */
  77.         /* This outer array below handles the case when the width table offset (WidthOffset:)
  78.            is zero. */
  79.         array [$$Long(WidthOffset) != 0] {
  80.     WidthTable:
  81.             integer = $$CountOf(WidthTable) - 1;                /* # of width tables    */
  82.             wide array WidthTable {
  83.                 fill bit[9];                                    /* Reserved                */
  84.                 Boolean        noExtendedStyle, EXTENDEDstyle;        /* Extended style        */
  85.                 Boolean        noCondensedStyle, CONDENSEDstyle;    /* Condensed style        */
  86.                 Boolean        noShadowStyle, SHADOWstyle;            /* Shadow style            */
  87.                 Boolean        noOutlineStyle, OUTLINEstyle;        /* Outline style        */
  88.                 Boolean        noUnderline, UNDERLINEstyle;        /* Underline style        */
  89.                 Boolean        noItalicStyle, ITALICstyle;            /* Italic style            */
  90.                 Boolean        noBoldStyle, BOLDstyle;                /* Bold style            */
  91.                 
  92.                 wide array [$$Word(Last) - $$Word(First) + 3] {
  93.                     unsigned hex integer;                        /* Width of character    */
  94.                 };
  95.             };
  96.         };
  97.     
  98.         /* Style Mapping Table */
  99.         /* This outer array below handles the case when the width table offset (WidthOffset:)
  100.            is zero. */
  101.         array [$$Long(StyleMapOffset) != 0] {
  102.     StyleTable:
  103.             unsigned hex integer;                                /* Font class            */
  104.     CharCodeOffset:
  105.             unsigned hex longint =                                /* Encoding table offset*/
  106.                 (CharCodeTable[1,1] - StyleTable[1]) / 8 * (CharCodeTable[1,1] != 0);
  107.             fill long;                                            /* Reserved                */
  108.             array [48] {
  109.                 byte;
  110.             };
  111.             /* Style Name Table */
  112.             integer = $$CountOf(StyleNames);                    /* Number of strings    */
  113.             pstring;                                            /* Full base font name    */
  114.             array StyleNames {
  115.                 pstring;                                        /* Style suffix names    */
  116.             };
  117.             
  118.             /* Character Set Encoding Table */
  119.             /* This outer array below handles the case when the character set encoding
  120.                offset is zero (CharCodeOffset:) */
  121.             array [$$Long(CharCodeOffset[1]) != 0] {
  122.     CharCodeTable:
  123.                 integer = $$CountOf(CharacterCodes);            /* Number of entries    */
  124.                 wide array CharacterCodes {
  125.                     char;                                        /* Character code        */
  126.                     pstring;                                    /* Char name string        */
  127.                 };
  128.             };
  129.         };
  130.  
  131.         /* Kerning Tables */
  132.         /* This outer array below handles the case when the kerning table offset
  133.            (KerningOffset:) is zero. */
  134.         array [$$Long(KerningOffset) != 0] {
  135.             /* Kerning Tables */
  136.     KerningTable:
  137.             integer = $$CountOf(KerningTables) - 1;                /* Number of tables        */
  138.             wide array KerningTables {
  139.                 fill bit[9];                                    /* Reserved                */
  140.                 Boolean        noExtendedStyle, EXTENDEDstyle;        /* Extended style        */
  141.                 Boolean        noCondensedStyle, CONDENSEDstyle;    /* Condensed style        */
  142.                 Boolean        noShadowStyle, SHADOWstyle;            /* Shadow style            */
  143.                 Boolean        noOutlineStyle, OUTLINEstyle;        /* Outline style        */
  144.                 Boolean        noUnderline, UNDERLINEstyle;        /* Underline style        */
  145.                 Boolean        noItalicStyle, ITALICstyle;            /* Italic style            */
  146.                 Boolean        noBoldStyle, BOLDstyle;                /* Bold style            */
  147.                 integer = $$CountOf(KerningTableEntry);            /* # of entries            */
  148.                 wide array KerningTableEntry {
  149.                     char;                                        /* first char of pair    */
  150.                     char;                                        /* second char of pair    */
  151.                     unsigned hex integer;                        /* kerning offset        */
  152.                 };
  153.             };
  154.         };
  155. };
  156. /*----------------------------FONT Ç Font Description-----------------------------------*/
  157. /* PROBLEMS: the offset to the offset/width table has been changed to a longint, with the
  158.              high word stored in the neg descent field (if its not -1).  Rez can't handle
  159.              this. */
  160. type 'FONT' {    
  161.         /* Font Type Flags */
  162.         boolean = 1;                                            /* Reserved                */
  163.         boolean        doExpandFont, dontExpandFont;
  164.         boolean        proportionalFont, fixedWidthFont;
  165.         boolean = 1;                                            /* Reserved                */
  166.         unsigned bitstring[2] = 0;                                /* Reserved                */
  167.         boolean        blackFont, colorFont;
  168.         boolean        notSynthetic, isSynthetic;
  169.         boolean        nofctbRsrc, hasfctbRsrc;
  170.         unsigned bitstring[3] = 0;                                /* Reserved                */
  171.         unsigned bitstring[2]    oneBit, twoBit,                    /* Font depth            */
  172.                                 fourBit, eightBit;
  173.         boolean        noCharWidthTable, hasCharWidthTable;
  174.         boolean        noImageHeightTable, hasImageHeightTable;
  175.  
  176.     FirstChar:
  177.         integer;                                                /* first char            */
  178.     LastChar:
  179.         integer;                                                /* last char            */
  180.         integer;                                                /* width max            */
  181.         integer;                                                /* kern max                */
  182.         integer;                                                /* neg descent            */
  183.         integer;                                                /* font rect width        */
  184.     Height:
  185.         integer;                                                /* font rect height        */
  186.     Offset:
  187.         unsigned integer = ((WidthTable-Offset)/16);            /* offset to off/wid tab*/        
  188.         integer;                                                /* ascent                */
  189.         integer;                                                /* descent                */
  190.         integer;                                                /* leading                */
  191.     RowWords:
  192.         integer;                                                /* row width (in words)    */
  193.         
  194.         /* Tables */
  195.         /* Bit image */
  196.         hex string [$$Word(RowWords) * $$Word(Height) * 2];
  197.  
  198.         /* Location Table */
  199.         array [$$Word(LastChar) - $$Word(FirstChar) + 3] {
  200.             integer;
  201.         };
  202.         
  203.         /* Offset/Width Table */
  204.     WidthTable:
  205.         array [$$Word(LastChar) - $$Word(FirstChar) + 3] {
  206.             integer;
  207.         };
  208.  
  209.         /* Don't know what this table does, but it needs to be there - Table */
  210.     UnknownTable:
  211.         array [$$Word(LastChar) - $$Word(FirstChar) + 3] {
  212.             integer;
  213.         };
  214. };
  215. /*----------------------------NFNT Ç Font Description-----------------------------------*/
  216. type 'NFNT' as 'FONT';
  217.