Top  | Previous | Next

Type Casting / toFont

toFont(value, [failover])

Coerces a string into a font. The string must be in the format:

font(fontName, fontType, fontSize)

 

fontName is the name of the font to use. Note that special care must be taken with fonts, because of the web-launched nature of the clients. You can only use font names that exist on the client machines. The following font names are known as logical fonts, meaning that they are guaranteed to exist on all systems, mapped to the most appropriate real, or physical font that exists on the host system:

Serif
SansSerif
Monospaced
Dialog
DialogInput

 

fontType is a string, that should match one of these (case-insensitive):

Plain
Bold
Italic
BoldItalic

 

fontSize is an integer that represent the font's point size.

 

toFont("font(Dialog,Bold,12)")

... returns the standard font used in most clients.