Class TTextureFontData
Unit
Declaration
type TTextureFontData = class(TObject)
Description
Data for a 2D font initialized from a FreeType font file, like ttf.
Hierarchy
- TObject
- TTextureFontData
Overview
Nested Classes and Records
TGlyph = class(TObject) |
|
TGlyphDictionary = class(specialize TDictionary<TUnicodeChar,TGlyph>) |
Methods
constructor Create(const AUrl: String; const ASize: Cardinal; const AnAntiAliased: Boolean; ACharacters: TUnicodeCharList = nil; const ADistanceField: Boolean = false); |
|
constructor CreateFromData(const AGlyphs: TGlyphDictionary; const AImage: TGrayscaleImage; const ASize: Cardinal; const AnAntiAliased: Boolean); |
|
destructor Destroy; override; |
|
function Glyph(const C: TUnicodeChar; const AllowUsingFallbackGlyph: Boolean = true): 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 GlyphDrawImageRect(const G: TTextureFontData.TGlyph): TRectangle; |
Properties
property Url: String read FUrl; |
|
property Size: Cardinal read FSize; |
|
property AntiAliased: Boolean read FAntiAliased; |
|
property UseFallbackGlyph: Boolean
read FUseFallbackGlyph write FUseFallbackGlyph default true; |
|
property Image: TGrayscaleImage read FImage; |
|
property DistanceField: Boolean read FDistanceField; |
Description
Methods
constructor Create(const AUrl: String; const ASize: Cardinal; const AnAntiAliased: Boolean; ACharacters: TUnicodeCharList = nil; const ADistanceField: Boolean = false); |
|
Create by reading a FreeType font file, like ttf. Providing charaters list as Exceptions raised
|
constructor CreateFromData(const AGlyphs: TGlyphDictionary; const AImage: TGrayscaleImage; const ASize: Cardinal; 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; |
|
This item has no description. |
function Glyph(const C: TUnicodeChar; const AllowUsingFallbackGlyph: Boolean = true): TGlyph; |
|
Read-only information about a glyph for given character. When AllowUsingFallbackGlyph and UseFallbackGlyph (both are When not (AllowUsingFallbackGlyph and UseFallbackGlyph) then we return |
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; |
|
This item has no description. |
function TextHeight(const S: string): Integer; |
|
This item has no description. |
function TextMove(const S: string): TVector2Integer; |
|
This item has no description. |
function GlyphDrawImageRect(const G: TTextureFontData.TGlyph): TRectangle; |
|
Rect of the glyph in the image, without the additional padding added when rendering with distance field fonts. To get the full rect of the glyph in the image, with padding, use G.ImageX, G.ImageY, G.Width, G.Height. |
Properties
property Url: String read FUrl; |
|
This item has no description. |
property Size: Cardinal read FSize; |
|
This item has no description. |
property AntiAliased: Boolean read FAntiAliased; |
|
This item has no description. |
property UseFallbackGlyph: Boolean
read FUseFallbackGlyph write FUseFallbackGlyph default true; |
|
When a glyph (picture of a particular character) in a font doesn't exist, by default we make a warning (using WritelnWarning) and use a fallback glyph, like "?". This lets user know that some character is there. Set this to |
property Image: TGrayscaleImage read FImage; |
|
This item has no description. |
property DistanceField: Boolean read FDistanceField; |
|
Is the font prepared for distance field rendering. |
Generated by PasDoc 0.16.0-snapshot.