Class TAdFont

DescriptionHierarchyFieldsMethodsProperties

Unit

Declaration

type TAdFont = class(TObject)

Description

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.

Hierarchy

Overview

Methods

Public constructor Create(AAppl:TAd2dApplication);
Public destructor Destroy; override;
Public procedure TextOut(ARect:TAdRect;AText:string); overload;
Public procedure TextOut(AX, AY:integer;AText:string); overload;
Public function TextWidth(AText:string):integer;
Public function TextHeight(AText:string):integer;
Public procedure Assign(AFont:TAdFont);

Properties

Public property AutoFreeTexture: boolean read FAutoFreeTexture write FAutoFreeTexture;
Public property TypeSetter: TAdTypeSetter read FTypeSetter write SetTypeSetter;
Public property Color: TAndorraColor read FColor write SetColor;
Public property Texture: TAd2dBitmapTexture read FTexture write FTexture;
Public property CharSizes: TAdCharSizes read FCharSizes write FCharSizes;
Public property CharPatterns: TAdCharPatterns read FCharPatterns write FCharPatterns;
Public property TransformationMatrix: TAdMatrix read FMatrix write FMatrix;
Public property Creator: Pointer read FCreator write FCreator;

Description

Methods

Public 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.

Public destructor Destroy; override;

Destroys the instance of TAdFont.

Public 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.

Public procedure TextOut(AX, AY:integer;AText:string); overload;

Prints one line of text defined by "AText".

Public function TextWidth(AText:string):integer;

Returns the width of the given text. Calls with the same text will automatically be buffered.

Public function TextHeight(AText:string):integer;

Returns the height of the given text. Calls with the same text will automatically be buffered.

Public procedure Assign(AFont:TAdFont);

Assigns the data of another to this font.

Properties

Public property AutoFreeTexture: boolean read FAutoFreeTexture write FAutoFreeTexture;

If true, the font destroys the bitmap font texture it is using when being freed.

Public property TypeSetter: TAdTypeSetter read FTypeSetter write SetTypeSetter;

Pointer on the type setter class used to set the text.

Public property Color: TAndorraColor read FColor write SetColor;

Color of the text.

Public property Texture: TAd2dBitmapTexture read FTexture write FTexture;

Pointer on the texture used by the font.

Public property CharSizes: TAdCharSizes read FCharSizes write FCharSizes;

Pointer on the array that contains the sizes of every letter in the bitmap font.

Public property CharPatterns: TAdCharPatterns read FCharPatterns write FCharPatterns;

Pointer on the array that contains the texture coordinates of every letter in the bitmap font.

Public property TransformationMatrix: TAdMatrix read FMatrix write FMatrix;

This matrix can be used to tranlate, rotate or scale the output.

Public property Creator: Pointer read FCreator write FCreator;

This pointer is internally used by Andorra 2D.

SourceForge.net Logo


Generated by PasDoc 0.11.0 on 2008-12-31 14:31:59