Class TGUIFont

DescriptionHierarchyFieldsMethodsProperties

Unit

Declaration

type TGUIFont = class(TReferenceCounted)

Description

Font interface.

Hierarchy

Overview

Methods

Public function GetCharacterFromPos(const Text: StringType; XPos: LongInt): LongInt; inline;
Public function GetKerningWidth(Letter: WideChar = #0; PreviousLetter: WideChar = #0): LongInt; inline;
Public function GetSize(const Text: StringType): TSize; inline;
Public procedure Draw(const Text: StringType; const Pos: TRect; Color: TARGBColor; HCenter: Boolean = False; VCenter: Boolean = False); overload; inline;
Public procedure Draw(const Text: StringType; const Pos: TRect; Color: TARGBColor; HCenter, VCenter: Boolean; const ClipRect: TRect); overload; inline;
Public procedure SetInvisibleCharacters(const Chars: StringType); inline;

Properties

Public property FontType: TGUIFontType read GetType;
Public property KerningHeight: LongInt read GetKerningHeight write SetKerningHeight;
Public property KerningWidth: LongInt read GetGlobalKerningWidth write SetKerningWidth;

Description

Methods

Public function GetCharacterFromPos(const Text: StringType; XPos: LongInt): LongInt; inline;

Calculates the index of the character in the text which is on a specific position.

Parameters
Text
Text string.
XPos
Horizontal pixel position of which the index of the character will be returned.
Returns

The zero based index of the character in the text, and -1 if no no character is on this position. (=the text is too short).

Public function GetKerningWidth(Letter: WideChar = #0; PreviousLetter: WideChar = #0): LongInt; inline;

Gets kerning values (distance between letters) for the font. If no parameters are provided, the global kerning distance is returned.

Parameters
Letter
If this parameter is provided, the left side kerning for this letter is added to the global kerning value. For example, a space might only be one pixel wide, but it may be displayed as several pixels.
PreviousLetter
If provided, kerning is calculated for both letters and added to the global kerning value. For example, in a font which supports kerning pairs a string such as 'Wo' may have the 'o' tucked neatly under the 'W'.
Public function GetSize(const Text: StringType): TSize; inline;

Calculates the width and height of a given string of text.

Returns

Width and height of the area covered by the text if it would be drawn.

Public procedure Draw(const Text: StringType; const Pos: TRect; Color: TARGBColor; HCenter: Boolean = False; VCenter: Boolean = False); overload; inline;

Draws some text.
Overloaded for default parameters.

Parameters
Text
Text to draw.
Pos
Rectangle specifying position where to draw the text.
Color
Color of the text.
HCenter
Specifies if the text should be centered horizontally into the rectangle.
VCenter
Specifies if the text should be centered vertically into the rectangle.
Public procedure Draw(const Text: StringType; const Pos: TRect; Color: TARGBColor; HCenter, VCenter: Boolean; const ClipRect: TRect); overload; inline;

Draws some text and clips it to a specified rectangle.

Parameters
Text
Text to draw.
Pos
Rectangle specifying position where to draw the text.
Color
Color of the text.
HCenter
Specifies if the text should be centered horizontally into the rectangle.
VCenter
Specifies if the text should be centered vertically into the rectangle.
ClipRect
Optional pointer to a rectangle against which the text will be clipped.
Public procedure SetInvisibleCharacters(const Chars: StringType); inline;

Defines which characters should not be drawn by the font.
For example " " would not draw any space which is usually blank in most fonts.

Parameters
Chars
String of symbols which are not sent to the video driver.

Properties

Public property FontType: TGUIFontType read GetType;

The font type.

Public property KerningHeight: LongInt read GetKerningHeight write SetKerningHeight;

The global kerning height (vertical distance between characters).

Public property KerningWidth: LongInt read GetGlobalKerningWidth write SetKerningWidth;

The global kerning width (horizontal distance between characters).


Generated by PasDoc 0.12.1 on 2012-09-14 17:32:22