TBGRAFontQuality = ( |
| Quality to be used to render text |
|
| fqSystem, |
| | Use the system capabilities. It is rather fast however it may be not be smoothed. |
|
| fqSystemClearType, |
| | Use the system capabilities to render with ClearType. This quality is of course better than fqSystem however it may not be perfect. |
|
| fqFineAntialiasing, |
| | Garanties a high quality antialiasing. |
|
| fqFineClearTypeRGB, |
| | Fine antialiasing with ClearType in assuming an LCD display in red/green/blue order |
|
| fqFineClearTypeBGR); |
| | Fine antialiasing with ClearType in assuming an LCD display in blue/green/red order |
|
TFontPixelMetric = record |
| Measurements of a font |
|
| Defined: boolean; |
| | The values have been computed |
|
| Baseline, |
| | Position of the baseline, where most letters lie |
|
| xLine, |
| | Position of the top of the small letters (x being one of them) |
|
| CapLine, |
| | Position of the top of the UPPERCASE letters |
|
| DescentLine, |
| | Position of the bottom of letters like g and p |
|
| Lineheight: integer; |
| | Total line height including line spacing defined by the font |
|
TFontVerticalAnchor = ( |
| Vertical anchoring of the font. When text is drawn, a start coordinate is necessary. Text can be positioned in different ways. This enum defines what position it is regarding the font |
|
| fvaTop, |
| | The top of the font. Everything will be drawn below the start coordinate. |
|
| fvaCenter, |
| | The center of the font |
|
| fvaCapLine, |
| | The top of capital letters |
|
| fvaCapCenter, |
| | The center of capital letters |
|
| fvaXLine, |
| | The top of small letters |
|
| fvaXCenter, |
| | The center of small letters |
|
| fvaBaseline, |
| | The baseline, the bottom of most letters |
|
| fvaDescentLine, |
| | The bottom of letters that go below the baseline |
|
| fvaBottom); |
| | The bottom of the font. Everything will be drawn above the start coordinate |
|
TWordBreakHandler = procedure(var ABeforeUTF8, AAfterUTF8: string) of object; |
| Definition of a function that handles work-break |
|
TBGRATypeWriterAlignment = (twaTopLeft, twaTop, twaTopRight, twaLeft, twaMiddle, twaRight, twaBottomLeft, twaBottom, twaBottomRight); |
| Alignment for a typewriter, that does not have any more information than a square shape containing glyphs |
|
TBGRATypeWriterOutlineMode = (twoPath, twoFill, twoStroke, twoFillOverStroke, twoStrokeOverFill, twoFillThenStroke, twoStrokeThenFill); |
| How a typewriter must render its content on a Canvas2d |
|
TBGRACustomFontRenderer = class |
| Abstract class for all font renderers |
|
| 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', ... |
|
| 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 |
|
| FontQuality : TBGRAFontQuality; |
| | Specifies the quality of rendering. Default value is fqSystem |
|
| 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 |
|
| FontEmHeight: integer; |
| | Specifies the height of the font without taking into account additional line spacing. A negative value means that it is the full height instead |
|
| function GetFontPixelMetric: TFontPixelMetric; virtual; abstract; |
| | Returns measurement for the current font in pixels |
|
| function TextSize(sUTF8: string): TSize; 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 along the text |
|
| procedure TextOut(ADest: TBGRACustomBitmap; x, y: single; sUTF8: string; c: TBGRAPixel; align: TAlignment); 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); 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; c: TBGRAPixel; align: TAlignment); virtual; abstract; |
| | Same as above, except that the orientation is specified, overriding the value of the property FontOrientation |
|
| procedure TextOutAngle(ADest: TBGRACustomBitmap; x, y: single; orientationTenthDegCCW: integer; sUTF8: string; texture: IBGRAScanner; align: TAlignment); 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); 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); virtual; abstract; |
| | Same as above except a texture is used to fill the text |
|
| procedure CopyTextPathTo({%H-}ADest: IBGRAPath; {%H-}x, {%H-}y: single; {%H-}s: string; {%H-}align: TAlignment); virtual; //optional |
| | 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. |
|
TBGRATextOutImproveReadabilityMode = (irMask, irNormal, irClearTypeRGB, irClearTypeBGR); |
| Output mode for the improved renderer for readability. This is used by the font renderer based on LCL in BGRAText |
|
| function CleanTextOutString(s: string): string; |
| | Removes line ending and tab characters from a string (for a function like TextOut that does not handle this). this works with UTF8 strings as well |
|
| function RemoveLineEnding(var s: string; indexByte: integer): boolean; |
| | Remove the line ending at the specified position or return False. This works with UTF8 strings however the index is the byte index |
|
| function RemoveLineEndingUTF8(var sUTF8: string; indexUTF8: integer): boolean; |
| | Remove the line ending at the specified position or return False. The index is the character index, that may be different from the byte index |
|
| procedure BGRADefaultWordBreakHandler(var ABefore, AAfter: string); |
| | Default word break handler, that simply divide when there is a space |
|