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
- TObject
- TBGRACustomFontRenderer
- TBGRASystemFontRenderer
- TBGRATextEffectFontRenderer
Overview
Fields
FShader: TCustomPhongShading; |
|
FShaderOwner: boolean; |
|
FVectorizedRenderer: TBGRAVectorizedFontRenderer; |
|
OuterOutlineOnly: boolean; |
|
OutlineColor: TBGRAPixel; |
|
OutlineJoin: TPenJoinStyle; |
|
OutlineTexture: IBGRAScanner; |
|
OutlineVisible: boolean; |
|
OutlineWidth: single; |
|
ShaderActive: boolean; |
|
ShadowColor: TBGRAPixel; |
|
ShadowOffset: TPoint; |
|
ShadowQuality: TRadialBlurType; |
|
ShadowRadius: integer; |
|
ShadowVisible: boolean; |
Methods
constructor Create; overload; |
|
constructor Create(AShader: TCustomPhongShading; AShaderOwner: boolean); overload; |
|
destructor Destroy; override; |
|
function TextFitInfo(sUTF8: string; AMaxWidth: integer): integer; override; |
|
function TextSize(sUTF8: string): TSize; overload; override; |
|
function TextSize(sUTF8: string; AMaxWidth: integer; ARightToLeft: boolean): TSize; overload; override; |
|
function TextSizeAngle(sUTF8: string; orientationTenthDegCCW: integer): TSize; override; |
|
function TextVisible(const AColor: TBGRAPixel): boolean; override; |
|
function OutlineActuallyVisible: boolean; |
|
function ShaderActuallyActive: boolean; |
|
function ShadowActuallyVisible:boolean; |
|
function VectorizedFontNeeded(AOrientation: integer): boolean; |
|
procedure Init; |
|
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
property Shader: TCustomPhongShading read FShader; |
|
property ShaderLightPosition: TPoint read GetShaderLightPosition write SetShaderLightPosition; |
|
property ShaderLightPositionF: TPointF read GetShaderLightPositionF write SetShaderLightPositionF; |
|
property VectorizedFontRenderer: TBGRAVectorizedFontRenderer read GetVectorizedRenderer; |
Description
Fields
FShader: TCustomPhongShading; |
|
This item has no description. |
FShaderOwner: boolean; |
|
This item has no description. |
FVectorizedRenderer: TBGRAVectorizedFontRenderer; |
|
This item has no description. |
OuterOutlineOnly: boolean; |
|
This item has no description. |
OutlineColor: TBGRAPixel; |
|
This item has no description. |
OutlineJoin: TPenJoinStyle; |
|
This item has no description. |
OutlineTexture: IBGRAScanner; |
|
This item has no description. |
OutlineVisible: boolean; |
|
This item has no description. |
OutlineWidth: single; |
|
This item has no description. |
ShaderActive: boolean; |
|
This item has no description. |
ShadowColor: TBGRAPixel; |
|
This item has no description. |
ShadowOffset: TPoint; |
|
This item has no description. |
ShadowQuality: TRadialBlurType; |
|
This item has no description. |
ShadowRadius: integer; |
|
This item has no description. |
ShadowVisible: boolean; |
|
This item has no description. |
Methods
constructor Create; overload; |
|
This item has no description. |
constructor Create(AShader: TCustomPhongShading; AShaderOwner: boolean); overload; |
|
This item has no description. |
destructor Destroy; override; |
|
This item has no description. |
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 |
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 |
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 |
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 |
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 |
function OutlineActuallyVisible: boolean; |
|
This item has no description. |
function ShaderActuallyActive: boolean; |
|
This item has no description. |
function ShadowActuallyVisible:boolean; |
|
This item has no description. |
function VectorizedFontNeeded(AOrientation: integer): boolean; |
|
This item has no description. |
procedure Init; |
|
This item has no description. |
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
property Shader: TCustomPhongShading read FShader; |
|
This item has no description. |
property ShaderLightPosition: TPoint read GetShaderLightPosition write SetShaderLightPosition; |
|
This item has no description. |
property ShaderLightPositionF: TPointF read GetShaderLightPositionF write SetShaderLightPositionF; |
|
This item has no description. |
property VectorizedFontRenderer: TBGRAVectorizedFontRenderer read GetVectorizedRenderer; |
|
This item has no description. |