Class TPHXFont

DescriptionHierarchyFieldsMethodsProperties

Unit

Declaration

type TPHXFont = class(TObject)

Description

TPHXFont

Hierarchy

  • TObject
  • TPHXFont

Overview

Fields

Protected CharacterMap: TPHXCharacterMap;
Protected CharacterBuffer: array of TPHXCharacterBuffer;

Methods

Public constructor Create(ADevice: TPHXDevice; ACanvas: TPHXCanvas);
Public constructor CreateEx(ATexture: TPHXTexture);
Public destructor Destroy; override;
Public procedure LoadFromFile(const FileName: String);
Public procedure LoadFromStream(Stream: TStream);
Public procedure SaveToFile(const FileName: String);
Public procedure SaveToStream(Stream: TStream);
Public procedure Initialize;
Public function CharWidth(const Character: AnsiChar): Integer; overload;
Public function CharWidth(const Character: WideChar): Integer; overload;
Public function TextExtent(const Text: AnsiString): TVector2i; overload;
Public function TextExtent(const Text: WideString): TVector2i; overload;
Public function TextWidth(const Text: AnsiString): Integer; overload;
Public function TextWidth(const Text: WideString): Integer; overload;
Public function TextHeight(const Text: AnsiString): Integer; overload;
Public function TextHeight(const Text: WideString): Integer; overload;
Public procedure TextOut(const X, Y: Single; const Text: WideString); overload;
Public procedure TextOut(const X, Y: Single; const Text: WideString; const Color: TColor4f); overload;
Public procedure TextOut(const X, Y: Single; const Text: WideString; const ColorUp, ColorDown: TColor4f); overload;
Public procedure TextOut(const Position: TVector3f; const Text: WideString; const Color: TColor4f); overload;
Public procedure TextOut(const Position: TVector3f; const Text: WideString; const ColorA, ColorB: TColor4f); overload;
Public procedure TextOut(const Transform: TMatrix4; const Text: WideString; const Color: TColor4f); overload;
Public procedure TextOut(const Transform: TMatrix4; const Text: WideString; const ColorA, ColorB: TColor4f); overload;
Public procedure TextOut(const Rect: TRectf; const Text: WideString; const Align: TPHXTextAlign); overload;
Public procedure TextOut(const Rect: TRectf; const Text: WideString; const Align: TPHXTextAlign; const Color: TColor4f); overload;
Public procedure TextOut(const Rect: TRectf; const Text: WideString; const Align: TPHXTextAlign; const ColorT, ColorB: TColor4f); overload;
Public procedure TextOut(const Rect: TRecti; const Text: WideString; const Align: TPHXTextAlign); overload;
Public procedure TextOut(const Rect: TRecti; const Text: WideString; const Align: TPHXTextAlign; const Color: TColor4f); overload;
Public procedure TextOut(const Rect: TRecti; const Text: WideString; const Align: TPHXTextAlign; const ColorT, ColorB: TColor4f); overload;
Public procedure FormatText(const X, Y: Single; const Text: WideString; Args: array of const); overload;
Public function WrapText(const Rect: TRectf; const Text: WideString; const Alignment: TPHXAlignment): Boolean; overload;
Public function WrapText(const Rect: TRectf; const Text: WideString; const Alignment: TPHXAlignment; const Color: TColor4f): Boolean; overload;
Public function WrapText(const Rect: TRectf; const Text: WideString; const Alignment: TPHXAlignment; const ColorT, ColorB: TColor4f): Boolean; overload;
Public procedure TextOut(const X, Y: Single; const Lines: TStrings); overload;
Public procedure DrawSelection(const X,Y: Integer; const Text: WideString; const SelStart, SelLength: Integer); overload;
Public procedure DrawSelection(const X,Y: Integer; const Text: WideString; const SelStart, SelLength: Integer; const Color: TColor4f); overload;
Public procedure DrawSelection(const X,Y: Integer; const Text: WideString; const SelStart, SelLength: Integer; const Color: TColor4f; const Texture: TPHXTexture); overload;

Properties

Public property Device: TPHXDevice read FDevice;
Public property Canvas: TPHXCanvas read FCanvas;
Public property Name: String read FName write FName;
Public property Size: Integer read FSize write FSize;
Public property Style: TPHXFontStyles read FStyle write FStyle;
Public property Author: String read FAuthor write FAuthor;
Public property Version: String read FVersion write FVersion;
Public property Comment: String read FComment write FComment;
Public property Metric: TPHXTextMetric read FMetric;
Public property Characters: TPHXCharacterList read FCharacters;
Public property Kernings: TPHXKerningList read FKernings;
Public property Texture: TPHXTexture read FTexture;
Public property WrapMode: TPHXFontWrap read FWrapMode write FWrapMode;
Public property WrapChars: WideString read FWrapChars write FWrapChars;
Public property WrapStart: WideString read FWrapStart write FWrapStart;
Public property WrapEnd: WideString read FWrapEnd write FWrapEnd;
Public property Height: Integer read GetHeight;

Description

Fields

Protected CharacterMap: TPHXCharacterMap;
 
Protected CharacterBuffer: array of TPHXCharacterBuffer;
 

Methods

Public constructor Create(ADevice: TPHXDevice; ACanvas: TPHXCanvas);

Creates a new font

Public constructor CreateEx(ATexture: TPHXTexture);

Creates a new font for editing

Public destructor Destroy; override;

Destroys this font

Public procedure LoadFromFile(const FileName: String);

Load the font from file

Public procedure LoadFromStream(Stream: TStream);

Load the font from a stream

Public procedure SaveToFile(const FileName: String);

Save the font to a file

Public procedure SaveToStream(Stream: TStream);

Save the font to a stream

Public procedure Initialize;

Initializes the font, must be called before any rendering

Public function CharWidth(const Character: AnsiChar): Integer; overload;

Returns the width of a specific character.

Public function CharWidth(const Character: WideChar): Integer; overload;

Returns the width of a specific character.

Public function TextExtent(const Text: AnsiString): TVector2i; overload;

Returns the text size of a specific text.

Public function TextExtent(const Text: WideString): TVector2i; overload;

Returns the text size of a specific text.

Public function TextWidth(const Text: AnsiString): Integer; overload;

Returns the width of a specific text.

Public function TextWidth(const Text: WideString): Integer; overload;

Returns the width of a specific text.

Public function TextHeight(const Text: AnsiString): Integer; overload;

Returns the height of a specific text.

Public function TextHeight(const Text: WideString): Integer; overload;

Returns the height of a specific text.

Public procedure TextOut(const X, Y: Single; const Text: WideString); overload;

Draw text

Public procedure TextOut(const X, Y: Single; const Text: WideString; const Color: TColor4f); overload;

Draw colored text

Public procedure TextOut(const X, Y: Single; const Text: WideString; const ColorUp, ColorDown: TColor4f); overload;

Draw gradient text

Public procedure TextOut(const Position: TVector3f; const Text: WideString; const Color: TColor4f); overload;

Draw text

Public procedure TextOut(const Position: TVector3f; const Text: WideString; const ColorA, ColorB: TColor4f); overload;

Draw text

Public procedure TextOut(const Transform: TMatrix4; const Text: WideString; const Color: TColor4f); overload;

Draw transformed text with a color

Public procedure TextOut(const Transform: TMatrix4; const Text: WideString; const ColorA, ColorB: TColor4f); overload;

Draw transformed text with two colors

Public procedure TextOut(const Rect: TRectf; const Text: WideString; const Align: TPHXTextAlign); overload;

Draw alignmed text in a rectangle

Public procedure TextOut(const Rect: TRectf; const Text: WideString; const Align: TPHXTextAlign; const Color: TColor4f); overload;

Draw alignmed text in a rectangle with a single color

Public procedure TextOut(const Rect: TRectf; const Text: WideString; const Align: TPHXTextAlign; const ColorT, ColorB: TColor4f); overload;

Draw alignmed text in a rectangle with gradient colors

Public procedure TextOut(const Rect: TRecti; const Text: WideString; const Align: TPHXTextAlign); overload;

Draw alignmed text in a rectangle

Public procedure TextOut(const Rect: TRecti; const Text: WideString; const Align: TPHXTextAlign; const Color: TColor4f); overload;

Draw alignmed text in a rectangle with a single color

Public procedure TextOut(const Rect: TRecti; const Text: WideString; const Align: TPHXTextAlign; const ColorT, ColorB: TColor4f); overload;

Draw alignmed text in a rectangle with gradient colors

Public procedure FormatText(const X, Y: Single; const Text: WideString; Args: array of const); overload;

Draw a formatted text

Public function WrapText(const Rect: TRectf; const Text: WideString; const Alignment: TPHXAlignment): Boolean; overload;

Draw wrapped text, returns true if all text fitted inside the rectangle

Public function WrapText(const Rect: TRectf; const Text: WideString; const Alignment: TPHXAlignment; const Color: TColor4f): Boolean; overload;

Draw wrapped text with a single color, returns true if all text fitted inside the rectangle

Public function WrapText(const Rect: TRectf; const Text: WideString; const Alignment: TPHXAlignment; const ColorT, ColorB: TColor4f): Boolean; overload;

Draw wrapped text with a gradient color, returns true if all text fitted inside the rectangle

Public procedure TextOut(const X, Y: Single; const Lines: TStrings); overload;

Draw all lines in a string list

Public procedure DrawSelection(const X,Y: Integer; const Text: WideString; const SelStart, SelLength: Integer); overload;

Draw a selection rectangle for a text

Public procedure DrawSelection(const X,Y: Integer; const Text: WideString; const SelStart, SelLength: Integer; const Color: TColor4f); overload;

Draw a selection rectangle for a text with a given color

Public procedure DrawSelection(const X,Y: Integer; const Text: WideString; const SelStart, SelLength: Integer; const Color: TColor4f; const Texture: TPHXTexture); overload;

Draw a selection rectangle for a text with a given color and texture

Properties

Public property Device: TPHXDevice read FDevice;

The owning device

Public property Canvas: TPHXCanvas read FCanvas;

The canvas to draw to

Public property Name: String read FName write FName;

The name of the font.

Public property Size: Integer read FSize write FSize;

The size of the font.

Public property Style: TPHXFontStyles read FStyle write FStyle;

The font style

Public property Author: String read FAuthor write FAuthor;

Font author

Public property Version: String read FVersion write FVersion;

Version of the fon

Public property Comment: String read FComment write FComment;

Comment of the font

Public property Metric: TPHXTextMetric read FMetric;

Text metric

Public property Characters: TPHXCharacterList read FCharacters;

List of characters in the font

Public property Kernings: TPHXKerningList read FKernings;

List of kerning pairs in the font

Public property Texture: TPHXTexture read FTexture;

The font texture

Public property WrapMode: TPHXFontWrap read FWrapMode write FWrapMode;

Wrapping mode for the font

Public property WrapChars: WideString read FWrapChars write FWrapChars;

Wrapping characters for word wrap

Public property WrapStart: WideString read FWrapStart write FWrapStart;

The characters in this string may not start a line

Public property WrapEnd: WideString read FWrapEnd write FWrapEnd;

The characters in this string may not end a line

Public property Height: Integer read GetHeight;

The vertical distance between two text lines.


Generated by PasDoc 0.13.0 on 2013-08-26 11:02:37