TextTempl

Implements a formatted text chunk, that can be serialized in XML form. Has a linked list structure to easily link multiple chunks after each other.

Constructors

this
this(dstring text, CharacterFormattingInfo!BitmapType formatting, TextTempl!BitmapType next, int frontTab, BitmapType icon)

Creates a unit of formatted text from the supplied data.

this
this(TextTempl!BitmapType orig)

Copy CTOR

Members

Functions

font
Fontset!BitmapType font()

Returns the used font type.

getBlockWidth
int getBlockWidth()

Returns the width of the current text block in pixels.

getChar
dchar getChar(size_t pos)

Returns a character from the given position.

getWidth
int getWidth()

Returns the width of the text chain in pixels.

getWidth
int getWidth(sizediff_t begin, sizediff_t end)

Returns the width of a slice of the text chain in pixels.

insertChar
dchar insertChar(size_t pos, dchar c)

Inserts a given character at the given position. Return the inserted character if within bound, or dchar.init if position points to a place where it cannot be inserted easily.

offsetAmount
int offsetAmount(int pixel)

Returns the number of characters fully offset by the amount of pixel.

opIndex
Text!BitmapType opIndex(size_t index)

Indexing to refer to child items. Returns null if the given element isn't available.

overwriteChar
dchar overwriteChar(size_t pos, dchar c)

Overwrites a character at the given position. Returns the original character if within bound, or or dchar.init if position points to a place where it cannot be inserted easily.

removeChar
dchar removeChar(size_t pos)

Removes the character at the given position. Returns the removed character if within bound, or dchar.init if not.

removeChar
void removeChar(size_t begin, size_t end)

Removes a range of characters described by the begin and end position.

toDString
dstring toDString()

Returns the text as a 32bit string without the formatting.

Properties

charLength
size_t charLength [@property getter]

Returns the character lenght.

text
dstring text [@property getter]

Text accessor

text
dstring text [@property setter]

Text accessor

Variables

_text
dchar[] _text;

The text to be displayed

formatting
CharacterFormattingInfo!BitmapType formatting;

The formatting of this text block

frontTab
int frontTab;

Space before the text chunk in pixels. Can be negative.

icon
BitmapType icon;

Icon inserted in front of the text chunk.

iconOffsetX
byte iconOffsetX;

X offset of the icon if any

iconOffsetY
byte iconOffsetY;

Y offset of the icon if any

iconSpacing
byte iconSpacing;

Spacing after the icon if any

next
TextTempl!BitmapType next;

The next piece of formatted text block

Meta