Go to: Synopsis. Return value. Flags. Python examples.

Synopsis

fontDialog([FontList=boolean], [scalable=boolean])

Note: Strings representing object names and arguments must be separated by commas. This is not depicted in the synopsis.

fontDialog is undoable, NOT queryable, and NOT editable.

Displays a dialog of available fonts for the user to select from. The name of the selected font is returned, or an empty string if no font was selected.

When the FontList flag is used, no dialog is displayed. Instead the command returns an array of the available fonts.

Return value

stringDialog name

Flags

FontList, scalable
Long name (short name) Argument types Properties
FontList(fl) boolean create
Returns an array of all available font names. No dialog is displayed.
scalable(sc) boolean create
Limits the fonts returned or displayed to just those that are scalable.

Flag can appear in Create mode of command Flag can appear in Edit mode of command
Flag can appear in Query mode of command Flag can have multiple arguments, passed either as a tuple or a list.

Python examples

import maya.cmds as cmds

# Display a selection dialog containing all available fonts and save
# the one selected by the user.
font = cmds.fontDialog()

# Get an array of all available fonts.
fonts = cmds.fontDialog(FontList=True)

# Get an array of scalable fonts.
scalableFonts = cmds.fontDialog(FontList=True, scalable=True)