Class TFontStyleNode

Unit

Declaration

type TFontStyleNode = class(TAbstractFontStyleNode)

Description

Defines the size, family, style and other properties used for TTextNode.

Hierarchy

Overview

Nested Types

Published TFontEvent = procedure (const FontStyle: TFontStyleNode; var Font: TTextureFontData) of object;

Fields

Public nested const DefaultSize = 1.0;
Public nested const DefaultSpacing = 1.0;
Public nested const DefaultFamily = ffSerif;
Public nested const DefaultBold = false;
Public nested const DefaultItalic = false;
Public nested const DefaultJustify = fjBegin;
Public nested const DefaultJustifyMinor = fjFirst;
Public nested const DefaultBlending = true;
Public class var OnFont: TFontEvent deprecated 'use TFontStyleNode.CustomFont or TCastleText.CustomFont';

Methods

Public constructor Create(const AX3DName: string = ''; const ABaseUrl: string = ''); override;
Public destructor Destroy; override;
Public class function ForVRMLVersion(const Version: TX3DVersion): boolean; override;
Public function Font: TTextureFontData;
Public procedure CreateNode; override;
Public class function ClassX3DType: string; override;

Properties

Public property Family: TX3DFontFamily read GetFamily write SetFamily;
Public property Justify: TX3DFontJustify read GetJustify write SetJustify;
Public property JustifyMinor: TX3DFontJustify read GetJustifyMinor write SetJustifyMinor;
Public property Bold: boolean read GetBold write SetBold;
Public property Italic: boolean read GetItalic write SetItalic;
Public property CustomFont: TCastleFont read FCustomFont write SetCustomFont;
Public property FdFamily: TMFString read FFdFamily;
Public property FdHorizontal: TSFBool read FFdHorizontal;
Public property Horizontal: Boolean read GetHorizontal write SetHorizontal;
Public property FdJustify: TMFString read FFdJustify;
Public property FdLanguage: TSFString read FFdLanguage;
Public property Language: String read GetLanguage write SetLanguage;
Public property FdLeftToRight: TSFBool read FFdLeftToRight;
Public property LeftToRight: Boolean read GetLeftToRight write SetLeftToRight;
Public property FdSize: TSFFloat read FFdSize;
Public property Size: Single read GetSize write SetSize;
Public property FdSpacing: TSFFloat read FFdSpacing;
Public property Spacing: Single read GetSpacing write SetSpacing;
Public property FdStyle: TSFStringEnum read FFdStyle;
Public property Style: TX3DFontStyle read GetStyle write SetStyle;
Public property FdTopToBottom: TSFBool read FFdTopToBottom;
Public property TopToBottom: Boolean read GetTopToBottom write SetTopToBottom;
Public property FdBlending: TSFBool read FFdBlending;
Public property Blending: Boolean read GetBlending write SetBlending;

Description

Nested Types

Published TFontEvent = procedure (const FontStyle: TFontStyleNode; var Font: TTextureFontData) of object;
 

Fields

Public nested const DefaultSize = 1.0;
 
Public nested const DefaultSpacing = 1.0;
 
Public nested const DefaultFamily = ffSerif;
 
Public nested const DefaultBold = false;
 
Public nested const DefaultItalic = false;
 
Public nested const DefaultJustify = fjBegin;
 
Public nested const DefaultJustifyMinor = fjFirst;
 
Public nested const DefaultBlending = true;
 
Public class var OnFont: TFontEvent deprecated 'use TFontStyleNode.CustomFont or TCastleText.CustomFont';

Warning: this symbol is deprecated: use TFontStyleNode.CustomFont or TCastleText.CustomFont

Adjust the font. Assign here a callback which can modify a font. You can look at any font style properties to decide how to adjust the font, like Bold, Italic, Family.

You can always decide to leave the given "Font" instance at the default value, or to modify it.

The font instance set here is a TTextureFontData instance. You can load it from a TTF file by TTextureFontData.Create, or you can assign here a TTextureFontData instance defined by a unit generated by texture-font-to-pascal. See https://castle-engine.io/manual_text.php about using texture-font-to-pascal. In the first case, remember that it is your resposibility to free this font later, but only after all possible Text nodes using this font are destroyed.

Methods

Public constructor Create(const AX3DName: string = ''; const ABaseUrl: string = ''); override;
 
Public destructor Destroy; override;
 
Public class function ForVRMLVersion(const Version: TX3DVersion): boolean; override;
 
Public function Font: TTextureFontData;

Font used by this node, determined by our fields (like Bold) and OnFont.

Public procedure CreateNode; override;
 
Public class function ClassX3DType: string; override;
 

Properties

Public property Family: TX3DFontFamily read GetFamily write SetFamily;
 
Public property Justify: TX3DFontJustify read GetJustify write SetJustify;
 
Public property JustifyMinor: TX3DFontJustify read GetJustifyMinor write SetJustifyMinor;
 
Public property Bold: boolean read GetBold write SetBold;
 
Public property Italic: boolean read GetItalic write SetItalic;
 
Public property CustomFont: TCastleFont read FCustomFont write SetCustomFont;

Adjust the font.

TODO: Currently this only allows TCastleFont. In the future it should allow any TCastleAbstractFont, like TCastleFontFamily (thus have different options for bold/italic variants) or TCastleBitmapFont.

Public property FdFamily: TMFString read FFdFamily;
 
Public property FdHorizontal: TSFBool read FFdHorizontal;
 
Public property Horizontal: Boolean read GetHorizontal write SetHorizontal;
 
Public property FdJustify: TMFString read FFdJustify;
 
Public property FdLanguage: TSFString read FFdLanguage;
 
Public property Language: String read GetLanguage write SetLanguage;
 
Public property FdLeftToRight: TSFBool read FFdLeftToRight;
 
Public property LeftToRight: Boolean read GetLeftToRight write SetLeftToRight;
 
Public property FdSize: TSFFloat read FFdSize;
 
Public property Size: Single read GetSize write SetSize;
 
Public property FdSpacing: TSFFloat read FFdSpacing;
 
Public property Spacing: Single read GetSpacing write SetSpacing;
 
Public property FdStyle: TSFStringEnum read FFdStyle;
 
Public property Style: TX3DFontStyle read GetStyle write SetStyle;
 
Public property FdTopToBottom: TSFBool read FFdTopToBottom;
 
Public property TopToBottom: Boolean read GetTopToBottom write SetTopToBottom;
 
Public property FdBlending: TSFBool read FFdBlending;
 
Public property Blending: Boolean read GetBlending write SetBlending;
 

Generated by PasDoc 0.16.0.