Description | Hierarchy | Fields | Methods | Properties |
type TAdFont = class(TObject)
TAdFont is the base class that copes with text output. A font class represents the typeface and the "drawing instance" at once. You should not create a font class directly but use the TAdFontFactory class (AdDraw.Fonts) to create a font. When doing this, the typefaces are automatically buffered and no memory or creation time is wasted.
constructor Create(AAppl:TAd2dApplication); |
|
destructor Destroy; override; |
|
procedure TextOut(ARect:TAdRect;AText:string); overload; |
|
procedure TextOut(AX, AY:integer;AText:string); overload; |
|
function TextWidth(AText:string):integer; |
|
function TextHeight(AText:string):integer; |
|
procedure Assign(AFont:TAdFont); |
property AutoFreeTexture: boolean read FAutoFreeTexture write FAutoFreeTexture; |
|
property TypeSetter: TAdTypeSetter read FTypeSetter write SetTypeSetter; |
|
property Color: TAndorraColor read FColor write SetColor; |
|
property Texture: TAd2dBitmapTexture read FTexture write FTexture; |
|
property CharSizes: TAdCharSizes read FCharSizes write FCharSizes; |
|
property CharPatterns: TAdCharPatterns read FCharPatterns write FCharPatterns; |
|
property TransformationMatrix: TAdMatrix read FMatrix write FMatrix; |
|
property Creator: Pointer read FCreator write FCreator; |
constructor Create(AAppl:TAd2dApplication); |
|
Creates a new instance of TAdFont. Do not create fonts yourself unless you know what you're doing. Use the TAdFontFactory class instead (e.g. AdDraw.Fonts). When doing this, instances of the same typeface will automatically be stored - no memory will be wasted. |
destructor Destroy; override; |
|
Destroys the instance of TAdFont. |
procedure TextOut(ARect:TAdRect;AText:string); overload; |
|
Prints the text defined by "AText" to the defined output rectangle. To align the text use the type setter property. When using the simple type setter (TAdSimpleTypeSetter, what is default) simply set TAdSimpleTypeSetter(Font.TypeSetter).DrawMode. |
procedure TextOut(AX, AY:integer;AText:string); overload; |
|
Prints one line of text defined by "AText". |
function TextWidth(AText:string):integer; |
|
Returns the width of the given text. Calls with the same text will automatically be buffered. |
function TextHeight(AText:string):integer; |
|
Returns the height of the given text. Calls with the same text will automatically be buffered. |
procedure Assign(AFont:TAdFont); |
|
Assigns the data of another to this font. |
property AutoFreeTexture: boolean read FAutoFreeTexture write FAutoFreeTexture; |
|
If true, the font destroys the bitmap font texture it is using when being freed. |
property TypeSetter: TAdTypeSetter read FTypeSetter write SetTypeSetter; |
|
Pointer on the type setter class used to set the text. |
property Color: TAndorraColor read FColor write SetColor; |
|
Color of the text. |
property Texture: TAd2dBitmapTexture read FTexture write FTexture; |
|
Pointer on the texture used by the font. |
property CharSizes: TAdCharSizes read FCharSizes write FCharSizes; |
|
Pointer on the array that contains the sizes of every letter in the bitmap font. |
property CharPatterns: TAdCharPatterns read FCharPatterns write FCharPatterns; |
|
Pointer on the array that contains the texture coordinates of every letter in the bitmap font. |
property TransformationMatrix: TAdMatrix read FMatrix write FMatrix; |
|
This matrix can be used to tranlate, rotate or scale the output. |
property Creator: Pointer read FCreator write FCreator; |
|
This pointer is internally used by Andorra 2D. |