Name
SetFontStyle -- change the style of the current font
Synopsis
SetFontStyle(style, ...)
SetFontStyle(#SHADOW, color, distance, direction) (V2.5)
SetFontStyle(#EDGE, color, size) (V2.5)
Function
This function changes the current font's style to the one specified by style which must be one of the command-specific constants listed below.

The style argument can be one of the following constants:

#NORMAL:
Reset the font style to normal

#BOLD:
Set the font style to bold

#ITALIC:
Set the font style to italic

#UNDERLINED:
Set the font style to underlined

#ANTIALIAS:
Set the font style to anti-alias; please note that anti-aliasing is only available for true type fonts (V2.0)

#SHADOW:
Set the font style to shadow; your text will receive a shadow with this style; the second argument specifies the shadow color; this color can be either in RGB or ARGB notation; shadow transparency is fully supported; the third argument specifies the distance of the shadow from the main text in pixels; the fourth argument specifies the direction of the shadow; this must be one of the directional constants (V2.5)

#EDGE:
Set the font style to edge; a border of the specified size will be drawn around your text with this style; the second argument specifies the color for the border; this color can be either in RGB or ARGB notation; border transparency is fully supported; the third argument specifies the desired thickness of the border in pixels (V2.5)

Starting with Hollywood 2.0, you can specify multiple font styles in a single call by simply OR-ing them with another, e.g a call to SetFontStyle(#BOLD|#ITALIC) will set the font style to bold and italic. Obviously, the style #NORMAL is mutually exclusive and cannot be combined with any other style. Also note, that styles requiring additional arguments (i.e. #SHADOW and #EDGE) cannot be combined in a single call because Hollywood would not know then to which style the additional arguments belong.

Please note that TrueType fonts often have separate font faces for their respective styles. In that case, you should always use these specifically designed font faces because SetFontStyle() will create bold and italic styles using a custom algorithm that often does not look as good as hand-crafted bold or italic font faces do. Thus, if you are planning to use Arial in bold style, you should better use "Arial Bold" when calling SetFont() (or OpenFont() / @FONT) than using "Arial" and calling SetFontStyle() with #BOLD set afterwards.

Inputs
style
special style constant (see list above)
...
further optional arguments depend on the style passed as argument one (see above)
Example
SetFontStyle(#BOLD|#ITALIC)
The above code sets the font style to bold and italic.


SetFontStyle(#SHADOW, ARGB(128, $939393), 16, #SHDWSOUTHEAST)
The above code enables a half-transparent grey shadow which will be positioned 16 pixels to the south-east of the main text.

Show TOC