Castle Game Engine: CastleTextureFontData: Class TTextureFontData

# Class TTextureFontData
Description | Hierarchy | Internal Classes and Records | Fields | Methods | Properties
## Unit CastleTextureFontData ## Declaration `type TTextureFontData = class(TObject)` ## Description Data for a 2D font initialized from a FreeType font file, like ttf. ## Hierarchy TObject TTextureFontData ## Overview ### Internal Classes and Records
| `TGlyph = class(TObject)`
| `TGlyphDictionary = class(specialize TFPGMap<TUnicodeChar,TGlyph>)`
### Methods
| `constructor Create(const URL: string; const ASize: Integer; const AnAntiAliased: boolean; ACharacters: TUnicodeCharList = nil);`
| `constructor CreateFromData(const AGlyphs: TGlyphDictionary; const AImage: TGrayscaleImage; const ASize: Integer; const AnAntiAliased: boolean);`
| `destructor Destroy; override;`
| `function Glyph(const C: TUnicodeChar): TGlyph;`
| `function LoadedGlyphs: TUnicodeCharList;`
| `function TextWidth(const S: string): Integer;`
| `function TextHeight(const S: string): Integer;`
| `function TextHeightBase(const S: string): Integer;`
| `function TextMove(const S: string): TVector2Integer;`
| `function RowHeight: Integer;`
| `function RowHeightBase: Integer;`
| `function Descend: Integer;`
### Properties
| `property AntiAliased: boolean read FAntiAliased;`
| `property Size: Integer read FSize;`
| `property Image: TGrayscaleImage read FImage;`
## Description ### Methods
| `constructor Create(const URL: string; const ASize: Integer; const AnAntiAliased: boolean; ACharacters: TUnicodeCharList = nil);`
Create by reading a FreeType font file, like ttf. Providing charaters list as `Nil` means that we only create glyphs for SimpleAsciiCharacters, which includes only the basic ASCII characters. The ACharacters instance does not become owned by this object, so remember to free it after calling this constructor.
| `constructor CreateFromData(const AGlyphs: TGlyphDictionary; const AImage: TGrayscaleImage; const ASize: Integer; const AnAntiAliased: boolean);`
Create from a ready data for glyphs and image. Useful when font data is embedded inside the Pascal source code. AGlyphs instance, and AImage instance, become owned by this class.
| `destructor Destroy; override;`
| `function Glyph(const C: TUnicodeChar): TGlyph;`
Read-only information about a `glyph` for given character. `Nil` if given `glyph` not loaded (because was not requested at constructor, or because it doesn't exist in the font).
| `function LoadedGlyphs: TUnicodeCharList;`
List all characters for which glyphs are actually loaded. Glyph will answer non-nil exactly for these characters. The resulting list instance is owned by caller, so take care to free it.
| `function TextWidth(const S: string): Integer;`
| `function TextHeight(const S: string): Integer;`
| `function TextHeightBase(const S: string): Integer;`
The height (above the baseline) of the text. This doesn't take into account height of the text below the baseline (for example letter "y" has the tail below the baseline in most fonts).
| `function TextMove(const S: string): TVector2Integer;`
| `function RowHeight: Integer;`
Height of a row of text in this font. This may be calculated as simply `TextHeight('Wy')` for most normal fonts.
| `function RowHeightBase: Integer;`
Height (above the baseline) of a row of text in this font. Similar to TextHeightBase and TextHeight, note that `RowHeightBase` is generally smaller than RowHeight, because `RowHeightBase` doesn't care how low the letter may go below the baseline.
| `function Descend: Integer;`
How low the text may go below the baseline.
### Properties
| `property AntiAliased: boolean read FAntiAliased;`
| `property Size: Integer read FSize;`
| `property Image: TGrayscaleImage read FImage;`
Generated by PasDoc 0.13.0 on 2015-06-15 04:43:12