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
- TObject
- TPersistent
- TComponent
- TCastleComponent
- TCastleAbstractFont
- TCastleFontFamily
Overview
Methods
procedure Notification(AComponent: TComponent; Operation: TOperation); override; |
|
constructor Create(AOwner: TComponent); override; |
|
destructor Destroy; override; |
|
function PropertySections(const PropertyName: String): TPropertySections; override; |
|
function FontLoaded: Boolean; 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; |
Properties
property InternalBold: boolean read FInternalBold write FInternalBold default false; |
|
property InternalItalic: boolean read FInternalItalic write FInternalItalic default false; |
|
property CustomizeOutline: boolean read FCustomizeOutline write FCustomizeOutline default false; |
|
property RegularFont: TCastleAbstractFont read FRegular write SetRegular; deprecated 'use Regular'; |
|
property BoldFont: TCastleAbstractFont read FBold write SetBold; deprecated 'use Bold'; |
|
property ItalicFont: TCastleAbstractFont read FItalic write SetItalic; deprecated 'use Italic'; |
|
property BoldItalicFont: TCastleAbstractFont read FBoldItalic write SetBoldItalic; deprecated 'use BoldItalic'; |
|
property Regular: TCastleAbstractFont read FRegular write SetRegular; |
|
property Bold: TCastleAbstractFont read FBold write SetBold; |
|
property Italic: TCastleAbstractFont read FItalic write SetItalic; |
|
property BoldItalic: TCastleAbstractFont read FBoldItalic write SetBoldItalic; |
Description
Methods
procedure Notification(AComponent: TComponent; Operation: TOperation); override; |
|
This item has no description. |
constructor Create(AOwner: TComponent); override; |
|
This item has no description. |
destructor Destroy; override; |
|
This item has no description. |
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. |
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. |
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 |
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. |
function TextWidth(const S: string): Single; override; |
|
This item has no description. |
function TextHeight(const S: string): Single; override; |
|
This item has no description. |
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). |
function TextMove(const S: string): TVector2; override; |
|
This item has no description. |
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
property InternalBold: boolean read FInternalBold write FInternalBold default false; |
|
This item has no description. |
property InternalItalic: boolean read FInternalItalic write FInternalItalic default false; |
|
This item has no description. |
property CustomizeOutline: boolean read FCustomizeOutline write FCustomizeOutline default false; |
|
Should we customize the outline of the underlying font. |
property RegularFont: TCastleAbstractFont read FRegular write SetRegular; deprecated 'use Regular'; |
|
Warning: this symbol is deprecated: use Regular This item has no description. |
property BoldFont: TCastleAbstractFont read FBold write SetBold; deprecated 'use Bold'; |
|
Warning: this symbol is deprecated: use Bold This item has no description. |
property ItalicFont: TCastleAbstractFont read FItalic write SetItalic; deprecated 'use Italic'; |
|
Warning: this symbol is deprecated: use Italic This item has no description. |
property BoldItalicFont: TCastleAbstractFont read FBoldItalic write SetBoldItalic; deprecated 'use BoldItalic'; |
|
Warning: this symbol is deprecated: use BoldItalic This item has no description. |
property Regular: TCastleAbstractFont read FRegular write SetRegular; |
|
This item has no description. |
property Bold: TCastleAbstractFont read FBold write SetBold; |
|
This item has no description. |
property Italic: TCastleAbstractFont read FItalic write SetItalic; |
|
This item has no description. |
property BoldItalic: TCastleAbstractFont read FBoldItalic write SetBoldItalic; |
|
This item has no description. |
Generated by PasDoc 0.16.0-snapshot.