Documentation

This is machine translation

Translated by Microsoft
Mouse over text to see original. Click the button below to return to the English verison of the page.

uisetfont

Open font selection dialog box

Syntax

uisetfont
uisetfont(h)
uisetfont(S)
uisetfont(...,'DialogTitle')
S = uisetfont(...)

Description

uisetfont enables you to change font properties (FontName, FontUnits, FontSize, FontWeight, and FontAngle) for a text, axes, or uicontrol object. The function returns a structure consisting of font properties and values. You can specify an alternate title for the dialog box.

uisetfont displays a modal dialog box and returns the selected font properties.

    Note   A modal dialog box prevents the user from interacting with other windows before responding. For more information, see WindowStyle in Figure Properties.

uisetfont(h) displays a modal dialog box, initializing the font property values with the values of those properties for the object whose handle is h. Selected font property values are applied to the current object. If a second argument is supplied, it specifies a name for the dialog box.

uisetfont(S) displays a modal dialog box, initializing the font property values with the values defined for the specified structure (S). S must define legal values for one or more of these properties: FontName, FontUnits, FontSize, FontWeight, and FontAngle and the field names must match the property names exactly. If other properties are defined, they are ignored. If a second argument is supplied, it specifies a name for the dialog box.

uisetfont(...,'DialogTitle') displays a modal dialog box with the title DialogTitle and returns the values of the font properties selected in the dialog box.

S = uisetfont(...) returns the properties FontName, FontUnits, FontSize, FontWeight, and FontAngle as fields in a structure. If the user presses Cancel from the dialog box or if an error occurs, the output value is set to 0.

Examples

Set Font Characteristics for a Plot Annotation

Create a plot containing a text annotation

f = figure('Position',[200 200 392 294]),;
x = 0:pi/20:2*pi;
y = sin(x);
plot(x,y);
t = text(pi,0,'\leftarrow sin(\pi)');

Open the Font dialog box, and select the Bold Italic style. The fonts displayed in the dialog box might be different on your system.

S = uisetfont(t);

After you click OK, the font style changes in the plot.

See Also

| |

Introduced before R2006a

Was this topic helpful?