User`s guide

11 Lay Out a Programmatic GUI
Set Font Charact
eristics Interactively
The uisetfont GU
I gives you access to the characteristics of all fonts on your
system. Use it to
set font characteristics for any component that displays text.
It returns a str
ucture containing data that describes the property values
you chose.
FontData = uisetfont(object_handle )
FontData =
FontName: 'Aria l'
FontWeight: 'b old'
FontAngle: 'n orm al'
FontSize: 10
FontUnits: 'p oin ts'
uisetfont
returns all font characteristics at once. You cannot omit any of
them u nless you delete a field from th e structure. You can use
uisetfont
when creating a component that has a S trin g property. You can also specify
the string itself at the same time by calling
inputdlg, which is a predefined
GUI for entering text s trings. Here is an example that creates static text, sets
the font properties, and positions it interactively:
txt1 = uicontrol(...
'Style','text',...
11-62