Class TCastleFontFamily

Unit

Declaration

type TCastleFontFamily = class(TCastleAbstractFont)

Description

Font family, with possible different subfonts for Regular, Bold, Italic, BoldItalic variants.

It can be generally used everywhere where we allow TCastleAbstractFont, and in most cases it will just act like the Regular variant. But it is especialy useful together with TCastleLabel.Html = True. In such case, using it as TCastleLabel.CustomFont will allow to render HTML text with varying font styles, this way bold/italic requested by HTML like <b>something bold</b> <i>something italic</i> will be visible.

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 TCastleFontFamily wrappers).

Hierarchy

Overview

Methods

Protected procedure Notification(AComponent: TComponent; Operation: TOperation); override;
Public constructor Create(AOwner: TComponent); override;
Public destructor Destroy; override;
Public function PropertySections(const PropertyName: String): TPropertySections; override;
Public function FontLoaded: Boolean; 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 InternalBold: boolean read FInternalBold write FInternalBold default false;
Public property InternalItalic: boolean read FInternalItalic write FInternalItalic default false;
Public property CustomizeOutline: boolean read FCustomizeOutline write FCustomizeOutline default false;
Public property RegularFont: TCastleAbstractFont read FRegular write SetRegular; deprecated 'use Regular';
Public property BoldFont: TCastleAbstractFont read FBold write SetBold; deprecated 'use Bold';
Public property ItalicFont: TCastleAbstractFont read FItalic write SetItalic; deprecated 'use Italic';
Public property BoldItalicFont: TCastleAbstractFont read FBoldItalic write SetBoldItalic; deprecated 'use BoldItalic';
Published property Regular: TCastleAbstractFont read FRegular write SetRegular;
Published property Bold: TCastleAbstractFont read FBold write SetBold;
Published property Italic: TCastleAbstractFont read FItalic write SetItalic;
Published property BoldItalic: TCastleAbstractFont read FBoldItalic write SetBoldItalic;

Description

Methods

Protected procedure Notification(AComponent: TComponent; Operation: TOperation); override;

This item has no description.

Public constructor Create(AOwner: TComponent); override;

This item has no description.

Public destructor Destroy; override;

This item has no description.

Public function PropertySections(const PropertyName: String): TPropertySections; override;

This item has no description. Showing description inherited from TCastleComponent.PropertySections.

Section where to show property in the editor.

Public function FontLoaded: Boolean; override;

This item has no description. Showing description inherited from TCastleAbstractFont.FontLoaded.

If the font is loaded, it can actually display and measure some characters.

Public procedure PrepareResources; override;

This item has no description. Showing description inherited from TCastleAbstractFont.PrepareResources.

The font may require some OpenGL resources for drawing. You can explicitly create them using PrepareResources (although it is never needed, resources will be automatically created if needed). There's no public method to explicitly destroy them, they are always destroyed automatically.

Public procedure Print(const X, Y: Single; const Color: TCastleColor; const S: string); override;

This item has no description. Showing description inherited from TCastleAbstractFont.Print.

Draw text at the given position with given color. If the last Color component is not 1, the text is rendered with blending.

Overloaded version without X, Y uses WindowPos (but doesn't modify it, in contrast to PrintAndMove). Overloaded version without Color uses CurrentColor, last color set by glColorv. It is not adviced to use overloaded versions without X, Y or Color — using global state leads to messy code. You should upgrade your code to use the version that gets X,Y,Color explicitly.

May require 1 free slot on the attributes stack. May only be called when current matrix is modelview. Doesn't modify any OpenGL state or matrix, except it moves raster position.

Public function TextWidth(const S: string): Single; override;

This item has no description.

Public function TextHeight(const S: string): Single; override;

This item has no description.

Public function TextHeightBase(const S: string): Single; override;

This item has no description. Showing description inherited from TCastleAbstractFont.TextHeightBase.

The height (above the baseline) of the text. This doesn't take into account height of the text below the baseline (for example letter "y" has the tail below the baseline in most fonts).

Public function TextMove(const S: string): TVector2; override;

This item has no description.

Public function EffectiveSize: Single; override;

This item has no description. Showing description inherited from TCastleAbstractFont.EffectiveSize.

Non-zero font size. Usually same thing as Size, but in case of proxy font classes (like TCustomizedFont and TCastleFontFamily) it makes sure to never return zero (which, in case of font proxies, is allowed value for Size and means "use underlying font size").

Properties

Public property InternalBold: boolean read FInternalBold write FInternalBold default false;

This item has no description.

Public property InternalItalic: boolean read FInternalItalic write FInternalItalic default false;

This item has no description.

Public property CustomizeOutline: boolean read FCustomizeOutline write FCustomizeOutline default false;

Should we customize the outline of the underlying font.

Public property RegularFont: TCastleAbstractFont read FRegular write SetRegular; deprecated 'use Regular';

Warning: this symbol is deprecated: use Regular

This item has no description.

Public property BoldFont: TCastleAbstractFont read FBold write SetBold; deprecated 'use Bold';

Warning: this symbol is deprecated: use Bold

This item has no description.

Public property ItalicFont: TCastleAbstractFont read FItalic write SetItalic; deprecated 'use Italic';

Warning: this symbol is deprecated: use Italic

This item has no description.

Public property BoldItalicFont: TCastleAbstractFont read FBoldItalic write SetBoldItalic; deprecated 'use BoldItalic';

Warning: this symbol is deprecated: use BoldItalic

This item has no description.

Published property Regular: TCastleAbstractFont read FRegular write SetRegular;

This item has no description.

Published property Bold: TCastleAbstractFont read FBold write SetBold;

This item has no description.

Published property Italic: TCastleAbstractFont read FItalic write SetItalic;

This item has no description.

Published property BoldItalic: TCastleAbstractFont read FBoldItalic write SetBoldItalic;

This item has no description.


Generated by PasDoc 0.16.0-snapshot.