
    Type
    PfontGlyphPos_s  = ^fontGlyphPos_s;

  {*
   * @file font.h
   * @brief Shared font support.
    }

     charWidthInfo_s = record
          left : s8;
          glyphWidth : u8;
          charWidth : u8;
       end;
       

     TGLP_s = record
          cellWidth : u8;
          cellHeight : u8;
          baselinePos : u8;
          maxCharWidth : u8;
          sheetSize : u32;
          nSheets : u16;
          sheetFmt : u16;
          nRows : u16;
          nLines : u16;
          sheetWidth : u16;
          sheetHeight : u16;
          sheetData : ^u8;
       end;
       
     tag_CWDH_s = record
          startIndex : u16;
          endIndex : u16;
          next : ^CWDH_s;
          widths : array [0] of charWidthInfo_s;
       end;


       tag_CMAP_s = CMAP_s;
       tag_CMAP_s = record
            codeBegin : u16;
            codeEnd : u16;
            mappingMethod : u16;
            reserved : u16;
            next : ^CMAP_s;
            
           case longint of
              0 : ( indexOffset : u16 );
              1 : ( indexTable : array[0] of u16 );
              2 : ( ScanEnt : record
                               nScanEntries : u16;
                               scanEntries : array [0] of record
                                                          code : u16;
                                                          glyphIndex : u16;
                               end;
              );
         end;


       FINF_s = record
            signature : u32;
            sectionSize : u32;
            fontType : u8;
            lineFeed : u8;
            alterCharIndex : u16;
            defaultWidth : charWidthInfo_s;
            encoding : u8;
            tglp : ^TGLP_s;
            cwdh : ^CWDH_s;
            cmap : ^CMAP_s;
            height : u8;
            width : u8;
            ascent : u8;
            padding : u8;
         end;

       CFNT_s = record
            signature : u32;
            endianness : u16;
            headerSize : u16;
            version : u32;
            fileSize : u32;
            nBlocks : u32;
            finf : FINF_s;
         end;

       fontGlyphPos_s = record
            sheetIndex : cint;
            xOffset : double;
            xAdvance : double;
            width : double;
            texcoord : record
                 left : double;
                 top : double;
                 right : double;
                 bottom : double;
              end;
            vtxcoord : record
                 left : double;
                 top : double;
                 right : double;
                 bottom : double;
              end;
         end;
    {/ Flags for use with fontCalcGlyphPos. }

    function fontEnsureMapped:Result;cdecl;external;

    function fontGetCharWidthInfo(glyphIndex:cint):^charWidthInfo_s;cdecl;external;

    procedure fontCalcGlyphPos(out:PfontGlyphPos_s; glyphIndex:cint; flags:u32; scaleX:double; scaleY:double);cdecl;external;

    {/@ }

implementation


end.
