Formats and returns the given @text, optionally with colour when @withColour is set to a value that evaluates to true, and wrapped at the given @width.
The following tags can be used in the content of @text to provide extra formatting information to the engine:
<normal> - return colouring to normal screen defaults <bold> - enable high intensity for colours <black> - black (dark gray when bold enabled) <red> - red (bright red when bold enabled) <green> - green (bright green when bold enabled) <brown> - brown (yellow when bold enabled) <blue> - blue (bright blue when bold enabled) <magenta> - magenta (bright magenta when bold enabled) <cyan> - cyan (bright cyan when bold enabled) <gray> - gray (white when bold enabled) <blackBg> - black background <redBg> - red background <greenBg> - green background <brownBg> - brown background <blueBg> - blue background <magentaBg> - magenta background <cyanBg> - cyan background <grayBg> - gray background <newLine> - force a newline <space> - force a space <art> - content between two <art> tags is not formatted
Additionally the following caveats are applied when formatting the text:
- Colour tags take up no space (includes normal and bold).
- Newlines are ignored unless the following line is indented, or a second newline is encountered.
- Lines that are indented but which are too long will wrap without indentation.
- Single tokens that do not fit on current line are wrapped to next line or if they do not fit on a newline of their own then the token is split.
- Tokens are gathered from sequential characters not including a space.
Example:
@text = \ %stringFormat( \ %areaGetStat( elkin, comments ), @n->flags->ansiColour, 80 ) |