Class TCustomizedFont
Unit
Declaration
type TCustomizedFont = class(TCastleAbstractFont)
Description
Font that uses another TCastleAbstractFont for rendering and sizing, but modifies the underlying font size. Simply set the Size
property of this instance to non-zero to force the specific size.
The underlying font properties remain unchanged (so it can be still used for other purposes, directly or by other TCustomizedFont
wrappers).
Hierarchy
- TObject
- TPersistent
- TComponent
- TCastleComponent
- TCastleAbstractFont
- TCustomizedFont
Overview
Methods
procedure Notification(AComponent: TComponent; Operation: TOperation); override; |
|
constructor Create(AOwner: TComponent); override; |
|
destructor Destroy; override; |
|
procedure PrepareResources; override; |
|
procedure Print(const X, Y: Single; const Color: TCastleColor; const S: string); override; |
|
function TextWidth(const S: string): Single; override; |
|
function TextHeight(const S: string): Single; override; |
|
function TextHeightBase(const S: string): Single; override; |
|
function TextMove(const S: string): TVector2; override; |
|
function EffectiveSize: Single; override; |
|
function FontLoaded: Boolean; override; |
|
procedure AddAlternativeSourceFont(const ASourceFont: TCastleAbstractFont); |
|
procedure Load(const URL: string; const ASizes: array of Integer; const AnAntiAliased: boolean; const ACharacters: TUnicodeCharList = nil); |
|
function BestSourceFont(const ASize: Single): TCastleAbstractFont; |
Properties
property SourceFont: TCastleAbstractFont read FSourceFont write SetSourceFont; |
Description
Methods
procedure Notification(AComponent: TComponent; Operation: TOperation); override; |
|
constructor Create(AOwner: TComponent); override; |
|
destructor Destroy; override; |
|
procedure PrepareResources; override; |
|
procedure Print(const X, Y: Single; const Color: TCastleColor; const S: string); override; |
|
function TextWidth(const S: string): Single; override; |
|
function TextHeight(const S: string): Single; override; |
|
function TextHeightBase(const S: string): Single; override; |
|
function TextMove(const S: string): TVector2; override; |
|
function EffectiveSize: Single; override; |
|
function FontLoaded: Boolean; override; |
|
procedure AddAlternativeSourceFont(const ASourceFont: TCastleAbstractFont); |
|
Add any number of alternative source fonts. Before actually using them for rendering, we always choose the one with size most matching our desired Size. This way you can e.g. load the same font in sizes 10, 50, 100, and have good quality font rendering in various sizes. |
procedure Load(const URL: string; const ASizes: array of Integer; const AnAntiAliased: boolean; const ACharacters: TUnicodeCharList = nil); |
|
Load the same font to a number of textures with different sizes. At rendering, we will automatically use the best size. This sets SourceFont and AddAlternativeSourceFont. This allows to achieve better look than TTexturedFont with one size. |
function BestSourceFont(const ASize: Single): TCastleAbstractFont; |
|
Return SourceFont or one of the fonts added by AddAlternativeSourceFont, to have the font with TCastleAbstractFont.Size closest to the given ASize. |
Properties
property SourceFont: TCastleAbstractFont read FSourceFont write SetSourceFont; |
|
Generated by PasDoc 0.16.0.