Class TBGRACustomFontRenderer
Unit
Declaration
type TBGRACustomFontRenderer = class(TObject)
Description
Abstract class for all font renderers
Hierarchy
- TObject
- TBGRACustomFontRenderer
Overview
Fields
FFontEmHeightF: single; |
|
FontName: string; |
|
FontOrientation: integer; |
|
FontQuality: TBGRAFontQuality; |
|
FontStyle: TFontStyles; |
Methods
function FontExists(AName: string): boolean; virtual; abstract; |
|
function GetFontPixelMetric: TFontPixelMetric; virtual; abstract; |
|
function GetFontPixelMetricF: TFontPixelMetricF; virtual; |
|
function HandlesTextPath: boolean; virtual; |
|
function TextFitInfo(sUTF8: string; AMaxWidth: integer): integer; virtual; abstract; |
|
function TextFitInfoF(sUTF8: string; AMaxWidthF: single): integer; virtual; |
|
function TextSize(sUTF8: string; AMaxWidth: integer; ARightToLeft: boolean): TSize; overload; virtual; abstract; |
|
function TextSize(sUTF8: string): TSize; overload; virtual; abstract; |
|
function TextSizeAngle(sUTF8: string; orientationTenthDegCCW: integer): TSize; virtual; |
|
function TextSizeAngleF(sUTF8: string; orientationTenthDegCCW: integer): TPointF; virtual; |
|
function TextSizeF(sUTF8: string): TPointF; overload; virtual; |
|
function TextSizeF(sUTF8: string; AMaxWidthF: single; ARightToLeft: boolean): TPointF; overload; virtual; |
|
function TextVisible(const AColor: TBGRAPixel): boolean; virtual; |
|
function GetFontEmHeight: integer; |
|
procedure CopyTextPathTo(ADest: IBGRAPath; x, y: single; s: string; align: TAlignment); virtual; |
|
procedure CopyTextPathTo(ADest: IBGRAPath; x, y: single; s: string; align: TAlignment; ARightToLeft: boolean); virtual; |
|
procedure TextOut(ADest: TBGRACustomBitmap; x, y: single; sUTF8: string; texture: IBGRAScanner; align: TAlignment; ARightToLeft: boolean); overload; virtual; |
|
procedure TextOut(ADest: TBGRACustomBitmap; x, y: single; sUTF8: string; c: TBGRAPixel; align: TAlignment; ARightToLeft: boolean); overload; virtual; |
|
procedure TextOut(ADest: TBGRACustomBitmap; x, y: single; sUTF8: string; c: TBGRAPixel; align: TAlignment); overload; virtual; abstract; |
|
procedure TextOut(ADest: TBGRACustomBitmap; x, y: single; sUTF8: string; texture: IBGRAScanner; align: TAlignment); overload; virtual; abstract; |
|
procedure TextOutAngle(ADest: TBGRACustomBitmap; x, y: single; orientationTenthDegCCW: integer; sUTF8: string; texture: IBGRAScanner; align: TAlignment; ARightToLeft: boolean); overload; virtual; |
|
procedure TextOutAngle(ADest: TBGRACustomBitmap; x, y: single; orientationTenthDegCCW: integer; sUTF8: string; c: TBGRAPixel; align: TAlignment; ARightToLeft: boolean); overload; virtual; |
|
procedure TextOutAngle(ADest: TBGRACustomBitmap; x, y: single; orientationTenthDegCCW: integer; sUTF8: string; c: TBGRAPixel; align: TAlignment); overload; virtual; abstract; |
|
procedure TextOutAngle(ADest: TBGRACustomBitmap; x, y: single; orientationTenthDegCCW: integer; sUTF8: string; texture: IBGRAScanner; align: TAlignment); overload; virtual; abstract; |
|
procedure TextRect(ADest: TBGRACustomBitmap; ARect: TRect; x, y: integer; sUTF8: string; style: TTextStyle; c: TBGRAPixel); overload; virtual; abstract; |
|
procedure TextRect(ADest: TBGRACustomBitmap; ARect: TRect; x, y: integer; sUTF8: string; style: TTextStyle; texture: IBGRAScanner); overload; virtual; abstract; |
|
procedure SetFontEmHeight(AValue: integer); |
Properties
property FontEmHeight: integer read GetFontEmHeight write SetFontEmHeight; |
|
property FontEmHeightF: single read FFontEmHeightF write FFontEmHeightF; |
Description
Fields
FFontEmHeightF: single; |
|
Specifies the height of the font without taking into account additional line spacing. A negative value means that it is the full height instead |
FontName: string; |
|
Specifies the font to use. Unless the font renderer accept otherwise, the name is in human readable form, like 'Arial', 'Times New Roman', ... |
FontOrientation: integer; |
|
Specifies the rotation of the text, for functions that support text rotation. It is expressed in tenth of degrees, positive values going counter-clockwise |
FontQuality: TBGRAFontQuality; |
|
Specifies the quality of rendering. Default value is fqSystem |
FontStyle: TFontStyles; |
|
Specifies the set of styles to be applied to the font. These can be fsBold, fsItalic, fsStrikeOut, fsUnderline. So the value \[fsBold, fsItalic] means that the font must be bold and italic |
Methods
function FontExists(AName: string): boolean; virtual; abstract; |
|
Checks whether a font exists |
function GetFontPixelMetric: TFontPixelMetric; virtual; abstract; |
|
Returns measurement for the current font in pixels |
function GetFontPixelMetricF: TFontPixelMetricF; virtual; |
|
Returns measurement for the current font in fractional pixels |
function HandlesTextPath: boolean; virtual; |
|
Check whether the renderer can produce text path |
function TextFitInfo(sUTF8: string; AMaxWidth: integer): integer; virtual; abstract; |
|
Returns the number of Unicode characters that fit into the specified size |
function TextFitInfoF(sUTF8: string; AMaxWidthF: single): integer; virtual; |
|
Returns the number of Unicode characters that fit into the specified floating-point size |
function TextSize(sUTF8: string; AMaxWidth: integer; ARightToLeft: boolean): TSize; overload; virtual; abstract; |
|
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 TextSize(sUTF8: string): TSize; overload; virtual; abstract; |
|
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 TextSizeAngle(sUTF8: string; orientationTenthDegCCW: integer): TSize; virtual; |
|
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 TextSizeAngleF(sUTF8: string; orientationTenthDegCCW: integer): TPointF; virtual; |
|
Returns the total floating-point size of the string provided using the current font, with the given orientation, along the text |
function TextSizeF(sUTF8: string): TPointF; overload; virtual; |
|
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 |
function TextSizeF(sUTF8: string; AMaxWidthF: single; ARightToLeft: boolean): TPointF; overload; virtual; |
|
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 |
function TextVisible(const AColor: TBGRAPixel): boolean; virtual; |
|
Checks if any text would be visible using the specified color |
function GetFontEmHeight: integer; |
|
Retrieves the em-height of the font |
procedure CopyTextPathTo(ADest: IBGRAPath; x, y: single; s: string; align: TAlignment); virtual; |
|
Copy the path for the UTF8 encoded string into ADest. 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. |
procedure CopyTextPathTo(ADest: IBGRAPath; x, y: single; s: string; align: TAlignment; ARightToLeft: boolean); virtual; |
|
Same as above but with given RTL mode |
procedure TextOut(ADest: TBGRACustomBitmap; x, y: single; sUTF8: string; texture: IBGRAScanner; align: TAlignment; ARightToLeft: boolean); overload; virtual; |
|
Same as above but with given RTL mode |
procedure TextOut(ADest: TBGRACustomBitmap; x, y: single; sUTF8: string; c: TBGRAPixel; align: TAlignment; ARightToLeft: boolean); overload; virtual; |
|
Same as above but with given RTL mode |
procedure TextOut(ADest: TBGRACustomBitmap; x, y: single; sUTF8: string; c: TBGRAPixel; align: TAlignment); overload; virtual; abstract; |
|
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 |
procedure TextOut(ADest: TBGRACustomBitmap; x, y: single; sUTF8: string; texture: IBGRAScanner; align: TAlignment); overload; virtual; abstract; |
|
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 |
procedure TextOutAngle(ADest: TBGRACustomBitmap; x, y: single; orientationTenthDegCCW: integer; sUTF8: string; texture: IBGRAScanner; align: TAlignment; ARightToLeft: boolean); overload; virtual; |
|
Same as above but with given RTL mode |
procedure TextOutAngle(ADest: TBGRACustomBitmap; x, y: single; orientationTenthDegCCW: integer; sUTF8: string; c: TBGRAPixel; align: TAlignment; ARightToLeft: boolean); overload; virtual; |
|
Same as above but with given RTL mode |
procedure TextOutAngle(ADest: TBGRACustomBitmap; x, y: single; orientationTenthDegCCW: integer; sUTF8: string; c: TBGRAPixel; align: TAlignment); overload; virtual; abstract; |
|
Same as above, except that the orientation is specified in tenth of degrees CCW, overriding the value of the property FontOrientation |
procedure TextOutAngle(ADest: TBGRACustomBitmap; x, y: single; orientationTenthDegCCW: integer; sUTF8: string; texture: IBGRAScanner; align: TAlignment); overload; virtual; abstract; |
|
Same as above, except that the orientation is specified, overriding the value of the property FontOrientation |
procedure TextRect(ADest: TBGRACustomBitmap; ARect: TRect; x, y: integer; sUTF8: string; style: TTextStyle; c: TBGRAPixel); overload; virtual; abstract; |
|
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. |
procedure TextRect(ADest: TBGRACustomBitmap; ARect: TRect; x, y: integer; sUTF8: string; style: TTextStyle; texture: IBGRAScanner); overload; virtual; abstract; |
|
Same as above except a texture is used to fill the text |
procedure SetFontEmHeight(AValue: integer); |
|
Sets the font height as em-height |
Properties
property FontEmHeight: integer read GetFontEmHeight write SetFontEmHeight; |
|
Font em-height as an integer |
property FontEmHeightF: single read FFontEmHeightF write FFontEmHeightF; |
|
Font em-height as a single-precision floating point value |