MUI's text engine is very powerful and allows you to include special character codes for on-the-fly text formatting. For example, it is possible to specify text alignment and font style (bold, italics, etc.) using formatting codes. With MUI 3.9 or better it is even possible to embed images (from a Hollywood brush source) in your text objects.
Formatting codes always start with an escape character followed by a sequence of characters that describe the formatting code. In decimal notation the escape character equals ASCII code 27, which is 33 in octal and $1B in hexadecimal notation. Care has to be taken when using formatting codes because usage is different between XML files and Hollywood source files. In XML files the octal notation is used, i.e. you start an escape sequence using a backslash and the octal number 33 ('\33'). In Hollywood source codes, however, octal numbers are not supported after a backslash. Hollywood always expects the ASCII code in decimal notation after a backslash. That is why you have to use '\27' to initiate an escape sequence from Hollywood code.
To illustrate this difference a little bit better, let us have a look at two examples. Here is an example for creating a bold text object in an XML file. Bold text is enabled by using the character 'b' after the escape character:
<text id="mytext">\33bBold text</text>
You can see that the octal notation is used here because XML files expect an octal number after a backslash. In Hollywood, however, it is different because Hollywood expects a decimal character after a backslash. So here is how you have to specify escape codes when using them from a Hollywood source file:
mui.Set("mytext", "contents", "\27bBold text")
You can see that the code is the same except that we use \27b instead of \33b because Hollywood always uses decimal instead of octal numbers after a backslash.
The following formatting codes are currently supported:
Please note: These formatting codes can be used in all MUI strings, not only in text objects. You can e.g. format the columns of a listview or include images in a cycle gadget's entries.