Class TFontFamily

Unit

Declaration

type TFontFamily = class(TCastleFont)

Description

Font family, with different subfonts for normal, bold, italic, bold+italic variants. Used together with TRichText, that has powerful methods to render and wrap text with HTML elements (<b>, <i> etc. inside). During such processing and rendering, it automatically uses the correct subfont. It's closely tied with the TRichText class.

For simple operations, it simply uses the subfont indicated by the Bold and Italic properties. By default they are False, and then we simply use RegularFont. This class can be treated as a font itself, since it has all the measuring and rendering commands you expect from a font (and you could even use it as a subfont of another TFontFamily — weird but works, in which case the "TFontFamily used as a subfont" just acts as a proxy for the Regular subfont).

Similar to TCustomizedFont, it can also change the subfont size. Simply set the Size property of this instance to non-zero to force the specific size of all the underlying subfonts. You can also change the subfont outline, if CustomizeOutline is used. The underlying font properties remain unchanged for subfonts (so they can be still used for other purposes, directly or by other TCustomizedFont or TFontFamily wrappers).

Hierarchy

Overview

Methods

Protected procedure Notification(AComponent: TComponent; Operation: TOperation); override;
Public constructor Create(AOwner: TComponent); override;
Public destructor Destroy; override;
Public procedure PrepareResources; override;
Public procedure Print(const X, Y: Single; const Color: TCastleColor; const S: string); override;
Public function TextWidth(const S: string): Single; override;
Public function TextHeight(const S: string): Single; override;
Public function TextHeightBase(const S: string): Single; override;
Public function TextMove(const S: string): TVector2; override;
Public function EffectiveSize: Single; override;

Properties

Public property RegularFont: TCastleFont read FRegularFont write SetRegularFont;
Public property BoldFont: TCastleFont read FBoldFont write SetBoldFont;
Public property ItalicFont: TCastleFont read FItalicFont write SetItalicFont;
Public property BoldItalicFont: TCastleFont read FBoldItalicFont write SetBoldItalicFont;
Public property Bold: boolean read FBold write FBold default false;
Public property Italic: boolean read FItalic write FItalic default false;
Public property CustomizeOutline: boolean read FCustomizeOutline write FCustomizeOutline default false;

Description

Methods

Protected procedure Notification(AComponent: TComponent; Operation: TOperation); override;
 
Public constructor Create(AOwner: TComponent); override;
 
Public destructor Destroy; override;
 
Public procedure PrepareResources; override;
 
Public procedure Print(const X, Y: Single; const Color: TCastleColor; const S: string); override;
 
Public function TextWidth(const S: string): Single; override;
 
Public function TextHeight(const S: string): Single; override;
 
Public function TextHeightBase(const S: string): Single; override;
 
Public function TextMove(const S: string): TVector2; override;
 
Public function EffectiveSize: Single; override;
 

Properties

Public property RegularFont: TCastleFont read FRegularFont write SetRegularFont;
 
Public property BoldFont: TCastleFont read FBoldFont write SetBoldFont;
 
Public property ItalicFont: TCastleFont read FItalicFont write SetItalicFont;
 
Public property BoldItalicFont: TCastleFont read FBoldItalicFont write SetBoldItalicFont;
 
Public property Bold: boolean read FBold write FBold default false;
 
Public property Italic: boolean read FItalic write FItalic default false;
 
Public property CustomizeOutline: boolean read FCustomizeOutline write FCustomizeOutline default false;

Should we customize the outline of the underlying font.


Generated by PasDoc 0.15.0.