t = FontRequest(title$[, t])
t = FontRequest(title$[, font$, size])
title$
argument specifies the title
text for the requester's dialog window.
FontRequest()
supports several additional arguments. Before Hollywood 9.0, those
had to be passed as optional parameters (see above). Since Hollywood 9.0,
however, it is recommended to use the new syntax, which has a single optional
table argument that can be used to pass one or more optional arguments to
FontRequest()
.
The following table fields are recognized by this function:
Font:
Size:
X:
Y:
Width:
Height:
Upon return, FontRequest()
initializes a table containing all parameters
selected by the user and returns this table to the script. The return
table will have the following fields initialized:
Name:
Family:
Size:
Weight:
#FONTWEIGHT_THIN #FONTWEIGHT_EXTRALIGHT #FONTWEIGHT_ULTRALIGHT #FONTWEIGHT_LIGHT #FONTWEIGHT_BOOK #FONTWEIGHT_NORMAL #FONTWEIGHT_REGULAR #FONTWEIGHT_MEDIUM #FONTWEIGHT_SEMIBOLD #FONTWEIGHT_DEMIBOLD #FONTWEIGHT_BOLD #FONTWEIGHT_EXTRABOLD #FONTWEIGHT_ULTRABOLD #FONTWEIGHT_HEAVY #FONTWEIGHT_BLACK #FONTWEIGHT_EXTRABLACK #FONTWEIGHT_ULTRABLACK |
Slant:
#FONTSLANT_ROMAN #FONTSLANT_ITALIC #FONTSLANT_OBLIQUE |
Bold:
True
if the user chose a bold font style.
Italic:
True
if the user chose an italic font style.
Underline:
True
if the user chose an underlined font style.
StrikeOut:
True
if the user chose a striked out font style.
Color:
Please note that the Underline
, StrikeOut
, and Color
fields are not
supported on all platforms. If the host operating system's font dialog
does not support them, they will all be set to False
.
t = FontRequest("Select a font") NPrint("Font:", t.name) NPrint("Family:", t.family) NPrint("Size:", t.size) NPrint("Weight:", t.weight) NPrint("Slant:", t.slant) NPrint("Underline:", t.underline) NPrint("Strike:", t.strikeout) NPrint("Color:", HexStr(t.color))The code above pops up a font requester and then prints out all information gathered from the user.