Draw XXL supports rich text markup tags everywhere where a text is drawn. This is obviously the case for "DrawText.Write()" and alike, but you can use it also on many other occasions: In the text tag of a line, a vector, a point text tag, a shape text tag, the title or the line names of charts - simply everywhere where Draw XXL uses text.
Source Text
Result
This is<br>text with<br>line breaks.
This is <b>bold</b> text.
Stroke width:<br>Text with <sw=80000>variable boldness</sw>. *
This is text in <i>italics</i>.
This is <u>underlined</u> text.
This is <d>deleted</d> text.
This is text with variable <size=40>size</size>. **
This is text with variable <color=red>color</color>. ***
This is text with<br>an embedded icon: <icon=crown> ****
* The value is in parts per million of the letter width. The maximum value is 240000.
** A value of 11 means: normal unscaled text size.
*** The color can be supplied as color name or in # hexadecimal format, in the same way as Unitys own color markup does it: See here and here
**** These icons are available.
There are also some utility functions available in the DrawText class which make it easier to put your text into the markup tags. They return the text string enclosed in markup tags. The available utility functions are:
public static string MarkupBold(string stringToMark)
public static string MarkupBold(int intToMark)
public static string MarkupItalic(string stringToMark)
public static string MarkupItalic(int intToMark)
public static string MarkupDeleted(string stringToMark)
public static string MarkupDeleted(int intToMark)
public static string MarkupUnderlined(string stringToMark)
public static string MarkupUnderlined(int intToMark)
public static string MarkupStrokeWidth(string stringToMark, int strokeWidth_asPPMofSize) //maximum is 240000
public static string MarkupSize(string stringToMark, float sizeScaleFactor)
public static string MarkupSize(string stringToMark, int size_relTo_11)
public static string MarkupColor(string stringToMark, Color color)
public static string MarkupColor(string stringToMark, string colorAsHexHTMLString)
public static string MarkupColor(string stringToMark, bool truthValueThatColorShouldIndicate)
public static string MarkupIcon(DrawBasics.IconType icon)
public static string MarkupCustomHeightEmptyLine(float vertSize_relToTextSize)
public static string MarkupCustomHeightEmptyLine(int sizeMarkupValue)
public static string MarkupBoolDisplayer(string boolName, bool boolValueToDisplay, bool saveDrawnLines = false)
public static string MarkupBoolDisplayer(bool boolValueToDisplay, bool saveDrawnLines = false)