Class TBGRAFreeTypeFontRenderer

Unit

Declaration

type TBGRAFreeTypeFontRenderer = class(TBGRACustomFontRenderer)

Description

FreeType font renderer with effects.

To use, assign to FontRenderer property of TBGRABitmap.

To set the effects, keep a variable containing the TBGRAFreeTypeFontRenderer class and modify ShadowVisible and other effects parameters. The FontHinted property allows you to choose if the font is snapped to pixels to make it more readable.

Hierarchy

Overview

Fields

Public FontHinted: boolean;
Protected FShader: TCustomPhongShading;
Protected FShaderOwner: boolean;
Protected FTypeWriter: TBGRACustomTypeWriter;
Public OuterOutlineOnly: boolean;
Public OutlineColor: TBGRAPixel;
Public OutlineTexture: IBGRAScanner;
Public OutlineVisible: boolean;
Public ShaderActive: boolean;
Public ShadowColor: TBGRAPixel;
Public ShadowOffset: TPoint;
Public ShadowQuality: TRadialBlurType;
Public ShadowRadius: integer;
Public ShadowVisible: boolean;

Methods

Public constructor Create(AShader: TCustomPhongShading; AShaderOwner: boolean); overload;
Public constructor Create; overload;
Public destructor Destroy; override;
Public function FontExists(AName: string): boolean; override;
Public function GetFontPixelMetric: TFontPixelMetric; override;
Public function GetFontPixelMetricF: TFontPixelMetricF; override;
Public function TextFitInfo(sUTF8: string; AMaxWidth: integer): integer; override;
Public function TextFitInfoF(sUTF8: string; AMaxWidthF: single): integer; override;
Public function TextSize(sUTF8: string; AMaxWidth: integer; ARightToLeft: boolean): TSize; overload; override;
Public function TextSize(sUTF8: string): TSize; overload; override;
Public function TextSizeF(sUTF8: string): TPointF; overload; override;
Public function TextSizeF(sUTF8: string; AMaxWidthF: single; ARightToLeft: boolean): TPointF; overload; override;
Public function TextVisible(const AColor: TBGRAPixel): boolean; override;
Protected function GetTypeWriter: TBGRACustomTypeWriter;
Public procedure TextOut(ADest: TBGRACustomBitmap; x, y: single; s: string; c: TBGRAPixel; align: TAlignment); overload; override;
Public procedure TextOut(ADest: TBGRACustomBitmap; x, y: single; s: string; texture: IBGRAScanner; align: TAlignment); overload; override;
Public procedure TextOutAngle(ADest: TBGRACustomBitmap; x, y: single; orientation: integer; s: string; texture: IBGRAScanner; align: TAlignment); overload; override;
Public procedure TextOutAngle(ADest: TBGRACustomBitmap; x, y: single; orientation: integer; s: string; c: TBGRAPixel; align: TAlignment); overload; override;
Public procedure TextRect(ADest: TBGRACustomBitmap; ARect: TRect; x, y: integer; s: string; style: TTextStyle; texture: IBGRAScanner); overload; override;
Public procedure TextRect(ADest: TBGRACustomBitmap; ARect: TRect; x, y: integer; s: string; style: TTextStyle; c: TBGRAPixel); overload; override;
Protected procedure Init;
Protected procedure InternalTextOut(ADest: TBGRACustomBitmap; x, y: single; s: string; c: TBGRAPixel; align: TAlignment);
Protected procedure TextOutAnglePatch(ADest: TBGRACustomBitmap; x, y: single; orientation: integer; s: string; c: TBGRAPixel; tex: IBGRAScanner; align: TAlignment);
Protected procedure UpdateFont(ADisableClearType: boolean = false);

Properties

Public property Collection: TCustomFreeTypeFontCollection read GetCollection;
Public property ShaderLightPosition: TPoint read GetShaderLightPosition write SetShaderLightPosition;
Public property ShaderLightPositionF: TPointF read GetShaderLightPositionF write SetShaderLightPositionF;
Protected property TypeWriter: TBGRACustomTypeWriter read GetTypeWriter;

Description

Fields

Public FontHinted: boolean;

This item has no description.

Protected FShader: TCustomPhongShading;

This item has no description.

Protected FShaderOwner: boolean;

This item has no description.

Protected FTypeWriter: TBGRACustomTypeWriter;

This item has no description.

Public OuterOutlineOnly: boolean;

This item has no description.

Public OutlineColor: TBGRAPixel;

This item has no description.

Public OutlineTexture: IBGRAScanner;

This item has no description.

Public OutlineVisible: boolean;

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(AShader: TCustomPhongShading; AShaderOwner: boolean); overload;

This item has no description.

Public constructor Create; overload;

This item has no description.

Public destructor Destroy; override;

This item has no description.

Public function FontExists(AName: string): boolean; override;

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

Checks whether a font exists

Public function GetFontPixelMetric: TFontPixelMetric; override;

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

Returns measurement for the current font in pixels

Public function GetFontPixelMetricF: TFontPixelMetricF; override;

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

Returns measurement for the current font in fractional pixels

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 TextFitInfoF(sUTF8: string; AMaxWidthF: single): integer; override;

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

Returns the number of Unicode characters that fit into the specified floating-point size

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 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 TextSizeF(sUTF8: string): TPointF; overload; override;

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

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

Public function TextSizeF(sUTF8: string; AMaxWidthF: single; ARightToLeft: boolean): TPointF; overload; override;

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

Returns the total floating point 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 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 GetTypeWriter: TBGRACustomTypeWriter;

This item has no description.

Public procedure TextOut(ADest: TBGRACustomBitmap; x, y: single; s: string; c: TBGRAPixel; align: TAlignment); overload; override;

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

Draws the UTF8 encoded string, with color c. If align is taLeftJustify, (x, y) is the top-left corner. If align is taCenter, (x, y) is at the top and middle of the text. If align is taRightJustify, (x, y) is the top-right corner. The value of FontOrientation is taken into account, so that the text may be rotated

Public procedure TextOut(ADest: TBGRACustomBitmap; x, y: single; s: string; texture: IBGRAScanner; align: TAlignment); overload; override;

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

Same as above functions, except that the text is filled using texture. The value of FontOrientation is taken into account, so that the text may be rotated

Public procedure TextOutAngle(ADest: TBGRACustomBitmap; x, y: single; orientation: integer; s: string; texture: IBGRAScanner; align: TAlignment); overload; override;

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

Same as above, except that the orientation is specified, overriding the value of the property FontOrientation

Public procedure TextOutAngle(ADest: TBGRACustomBitmap; x, y: single; orientation: integer; s: string; c: TBGRAPixel; align: TAlignment); overload; override;

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

Same as above, except that the orientation is specified in tenth of degrees CCW, overriding the value of the property FontOrientation

Public procedure TextRect(ADest: TBGRACustomBitmap; ARect: TRect; x, y: integer; s: string; style: TTextStyle; texture: IBGRAScanner); overload; override;

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

Same as above except a texture is used to fill the text

Public procedure TextRect(ADest: TBGRACustomBitmap; ARect: TRect; x, y: integer; s: string; style: TTextStyle; c: TBGRAPixel); overload; override;

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

Draw the UTF8 encoded string at the coordinate (x, y), clipped inside the rectangle ARect. Additional style information is provided by the style parameter. The color c is used to fill the text. No rotation is applied.

Protected procedure Init;

This item has no description.

Protected procedure InternalTextOut(ADest: TBGRACustomBitmap; x, y: single; s: string; c: TBGRAPixel; align: TAlignment);

This item has no description.

Protected procedure TextOutAnglePatch(ADest: TBGRACustomBitmap; x, y: single; orientation: integer; s: string; c: TBGRAPixel; tex: IBGRAScanner; align: TAlignment);

This item has no description.

Protected procedure UpdateFont(ADisableClearType: boolean = false);

This item has no description.

Properties

Public property Collection: TCustomFreeTypeFontCollection read GetCollection;

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.

Protected property TypeWriter: TBGRACustomTypeWriter read GetTypeWriter;

This item has no description.