Compact Font Format

<< Click to Display Table of Contents >>

Navigation:  Font engine >

Compact Font Format

 TCFFFont = class
 public
   Header: TCFFHeader;
   NameIndex, TopDictIndex, StringIndex, GlobalSubrIndex, CharStringsIndex, FontDictIndex: TCFFIndex;
   LocalSubrIndexes: array of TCFFIndex;
   TopDict: TCFFDict;
   PrivateDicts, FontDicts: array of TCFFDict;
   Name: string;
   Charset: array of record CharCode: word; Name: string end//Glyph unicode code and name
   Encoding: array of word; //Glyph CID
   Ascent, Descent, LineGap, XHeight, CapHeight, UnderlinePosition, UnderlineThickness, ItalicAngle: integer;
   FirstChar, LastChar: integer;
   Widths: array of word;
   FontData: TBytes;
   CharStringType: integer;
   DefaultWidthX, NominalWidthX: word;
   IsType2: boolean;
   CMAP, CharsetCMAP: THtCMap;
   IsCIDFont: boolean;
   FDRanges: array of packed record First: word; FDIndex: byte end;
   EncodingName: string;
   FontMatrix: THtMatrixData;
   procedure ReadIndex(ST: TStream; var Res: TCFFIndex);
   procedure LoadfromStream(ST: TStream);
   procedure LoadfromType1Stream(ST: TStream);
   function AverageCharWidth: integer;
   function CharStringLocalSubr(CharIndex: integer): TPSSubroutines; end;
 

Header

 

CFF header

 

NameIndex, TopDictIndex, StringIndex, GlobalSubrIndex, CharStringsIndex, LocalSubrIndex, FontDictIndex

 

CFF indexes

 

TopDict, PrivateDict, FontDict

 

Font dictionaries

 

Name

 

Font name

 

Charset

 

Unicode code and adobe glyph name for font glyphs

 

Encoding

 

Glyph CIDs

 

Ascent, Descent, LineGap, XHeight, CapHeight, UnderlinePosition, UnderlineThickness, ItalicAngle

 

Font properties in design units

 

Widths

 

Glyph widths in design units

 

CharStringType

 

Type of data in CharStrings dictionary.

 

DefaulfWidthX, NiminalWidthX

 

Default and nominal glyph width

 

IsType2

 

Font type - Type2 or Type1

 

CMAP

 

Font characted map (glyph encoding).

 

IsCIDFont

 

CID font flag

 

FontMatrix

 

Font glyph matrix

 

 

LoadfromStream

 

Load Type2 font from stream

 

LoadfromType1Stream

 

Load Type1 font from stream

 

AverageCharWidth

 

Average glyph width

 

CharStringLocalSubr

 

Returnd subroutine for glyph