Class TBGRATextEffectFontRenderer

Unit

Declaration

type TBGRATextEffectFontRenderer = class(TBGRASystemFontRenderer)

Description

Font renderer with shadow and outline effects.

To use it, create an instance of this class and assign it to a TBGRABitmap.FontRenderer property. Now functions to draw text like TBGRABitmap.TextOut will use the chosen renderer. To set the effects, keep a variable containing the TBGRATextEffectFontRenderer instance and modify ShadowVisible and other effects parameters.

The TBGRATextEffectFontRenderer class makes use of other classes depending on the situation. For example, TBGRATextEffect, which is also in this unit, provides effects on a text mask. But the renderer also uses BGRAVectorize unit in order to have wide outlines, big texts or to rotate them at will.

Hierarchy

Overview

Fields

Protected FShader: TCustomPhongShading;
Protected FShaderOwner: boolean;
Protected FVectorizedRenderer: TBGRAVectorizedFontRenderer;
Public OuterOutlineOnly: boolean;
Public OutlineColor: TBGRAPixel;
Public OutlineJoin: TPenJoinStyle;
Public OutlineTexture: IBGRAScanner;
Public OutlineVisible: boolean;
Public OutlineWidth: single;
Public ShaderActive: boolean;
Public ShadowColor: TBGRAPixel;
Public ShadowOffset: TPoint;
Public ShadowQuality: TRadialBlurType;
Public ShadowRadius: integer;
Public ShadowVisible: boolean;

Methods

Public constructor Create; overload;
Public constructor Create(AShader: TCustomPhongShading; AShaderOwner: boolean); overload;
Public destructor Destroy; override;
Public function TextFitInfo(sUTF8: string; AMaxWidth: integer): integer; override;
Public function TextSize(sUTF8: string): TSize; overload; override;
Public function TextSize(sUTF8: string; AMaxWidth: integer; ARightToLeft: boolean): TSize; overload; override;
Public function TextSizeAngle(sUTF8: string; orientationTenthDegCCW: integer): TSize; override;
Public function TextVisible(const AColor: TBGRAPixel): boolean; override;
Protected function OutlineActuallyVisible: boolean;
Protected function ShaderActuallyActive: boolean;
Protected function ShadowActuallyVisible:boolean;
Protected function VectorizedFontNeeded(AOrientation: integer): boolean;
Protected procedure Init;
Protected procedure InternalTextOutAngle(ADest: TBGRACustomBitmap; x, y: single; AOrientation: integer; sUTF8: string; c: TBGRAPixel; texture: IBGRAScanner; align: TAlignment; AShowPrefix: boolean = false; ARightToLeft: boolean = false); override;

Properties

Public property Shader: TCustomPhongShading read FShader;
Public property ShaderLightPosition: TPoint read GetShaderLightPosition write SetShaderLightPosition;
Public property ShaderLightPositionF: TPointF read GetShaderLightPositionF write SetShaderLightPositionF;
Public property VectorizedFontRenderer: TBGRAVectorizedFontRenderer read GetVectorizedRenderer;

Description

Fields

Protected FShader: TCustomPhongShading;

This item has no description.

Protected FShaderOwner: boolean;

This item has no description.

Protected FVectorizedRenderer: TBGRAVectorizedFontRenderer;

This item has no description.

Public OuterOutlineOnly: boolean;

This item has no description.

Public OutlineColor: TBGRAPixel;

This item has no description.

Public OutlineJoin: TPenJoinStyle;

This item has no description.

Public OutlineTexture: IBGRAScanner;

This item has no description.

Public OutlineVisible: boolean;

This item has no description.

Public OutlineWidth: single;

This item has no description.

Public ShaderActive: boolean;

This item has no description.

Public ShadowColor: TBGRAPixel;

This item has no description.

Public ShadowOffset: TPoint;

This item has no description.

Public ShadowQuality: TRadialBlurType;

This item has no description.

Public ShadowRadius: integer;

This item has no description.

Public ShadowVisible: boolean;

This item has no description.

Methods

Public constructor Create; overload;

This item has no description.

Public constructor Create(AShader: TCustomPhongShading; AShaderOwner: boolean); overload;

This item has no description.

Public destructor Destroy; override;

This item has no description.

Public function TextFitInfo(sUTF8: string; AMaxWidth: integer): integer; override;

This item has no description. Showing description inherited from TBGRACustomFontRenderer.TextFitInfo.

Returns the number of Unicode characters that fit into the specified size

Public function TextSize(sUTF8: string): TSize; overload; override;

This item has no description. Showing description inherited from TBGRACustomFontRenderer.TextSize.

Returns the total size of the string provided using the current font. Orientation is not taken into account, so that the width is horizontal

Public function TextSize(sUTF8: string; AMaxWidth: integer; ARightToLeft: boolean): TSize; overload; override;

This item has no description. Showing description inherited from TBGRACustomFontRenderer.TextSize.

Returns the total size of the string provided given a maximum width and RTL mode, using the current font. Orientation is not taken into account, so that the width is along the text

Public function TextSizeAngle(sUTF8: string; orientationTenthDegCCW: integer): TSize; override;

This item has no description. Showing description inherited from TBGRACustomFontRenderer.TextSizeAngle.

Returns the total size of the string provided using the current font, with the given orientation in tenth of degrees CCW, along the text

Public function TextVisible(const AColor: TBGRAPixel): boolean; override;

This item has no description. Showing description inherited from TBGRACustomFontRenderer.TextVisible.

Checks if any text would be visible using the specified color

Protected function OutlineActuallyVisible: boolean;

This item has no description.

Protected function ShaderActuallyActive: boolean;

This item has no description.

Protected function ShadowActuallyVisible:boolean;

This item has no description.

Protected function VectorizedFontNeeded(AOrientation: integer): boolean;

This item has no description.

Protected procedure Init;

This item has no description.

Protected procedure InternalTextOutAngle(ADest: TBGRACustomBitmap; x, y: single; AOrientation: integer; sUTF8: string; c: TBGRAPixel; texture: IBGRAScanner; align: TAlignment; AShowPrefix: boolean = false; ARightToLeft: boolean = false); override;

This item has no description.

Properties

Public property Shader: TCustomPhongShading read FShader;

This item has no description.

Public property ShaderLightPosition: TPoint read GetShaderLightPosition write SetShaderLightPosition;

This item has no description.

Public property ShaderLightPositionF: TPointF read GetShaderLightPositionF write SetShaderLightPositionF;

This item has no description.

Public property VectorizedFontRenderer: TBGRAVectorizedFontRenderer read GetVectorizedRenderer;

This item has no description.