54.36 Text format tags

Since version 2.5 Hollywood is able to do text formatting on-the-fly. The Print(), CreateTextObject(), and TextOut() commands support special format tags that allow you to change the text color and style without calling SetFontStyle() or SetFontColor().

The following format tags are currently available:

[b]:
Change font style to 'bold'. Use [/b] to cancel 'bold' style.

[i]:
Change font style to 'italic'. Use [/i] to cancel 'italic' style.

[u]:
Change font style to 'underlined'. Use [/u] to cancel 'underlined' style.

[shadow=color,size,direction]:
Adds a shadow effect to the text. The new shadow will then use the color specified in color. It will run for the pixel distance specified in the argument size and it will be oriented according to the direction specified in direction. Please use any of the 8 directional constants as the direction argument. The color can be in RGB or ARGB notation. Shadow transparency is fully supported. Use [/shadow] to cancel 'shadow' style. Note that when palette mode is set to #PALETTEMODE_PEN and the text is drawn to a palette target, the color argument must not be an RGB color but a palette pen.

[border=color,size]:
Adds a border effect to the text. This border will use the color specified in color and the size specified in size. The color can be a RGB or ARGB color specification. Border transparency is fully supported. Use [/border] to cancel border style. Note that when palette mode is set to #PALETTEMODE_PEN and the text is drawn to a palette target, the color argument must not be an RGB color but a palette pen. Before Hollywood 9.0, this tag was known as 'edge'.

[color=color]:
Change font color to color. This color can be in RGB or ARGB notation. If you pass an ARGB value, the text will be rendered with blending. Use [/color] to abort rendering in the current color and return to the previously active color.

[pen=pen]:
When palette mode is set to #PALETTEMODE_PEN and the text is drawn to a palette target, this tag can be used to change the drawing pen. Use [/pen] to restore the pen that was previously active. (V9.0)

[bulletcolor=color]:
Change bullet color to color. Bullets are only used when TextOut() is used in list mode. See TextOut for details. The color you pass to this tag can be in RGB or ARGB notation. If you pass an ARGB value, the bullet will be rendered with blending. Note that in contrast to all other tags above, this tag must not be closed. It just acts as a directive for the format processor to modify the current bullet color. So you must never close it using [/bulletcolor]. (V9.0)

[bulletpen=pen]:
Change bullet pen to pen. Bullets are only used when TextOut() is used in list mode. See TextOut for details. Note that in contrast to all other tags above, this tag must not be closed. It just acts as a directive for the format processor to modify the current bullet pen. So you must never close it using [/bulletpen]. (V9.0)

Please note that because of these format tags you have to use two square brackets if you want to have a square bracket in your text. If there is only one square bracket Hollywood will always expect a format tag.

Here is an example how you can use these format tags with the commands of the text library:

 
Print("Normal [b]Bold[/b] [i]Italic[/i] [u]Underlined[/u]")

As you can see, using format tags is really easy and makes the Hollywood text processor very powerful for advanced text formatting.


Show TOC