MATLAB Creating Graphical User Interfaces

(Barry) #1

6 Lay Out a UI Using GUIDE


Design Cross-Platform UIs in GUIDE


In this section...
“Default System Font” on page 6- 120
“Standard Background Color” on page 6- 121
“Cross-Platform Compatible Units” on page 6- 121

Default System Font


By default, user interface controls (uicontrols) use the default font for the platform
on which they are running. For example, when displaying your UI on PCs, uicontrols
use MS San Serif. When your program runs on a different platform, it uses that
computer's default font. This provides a consistent look with respect to your UI and other
applications.

If you have set the FontName property to a named font and want to return to the default
value, you can set the property to the string default. This ensures that the software
uses the system default at run-time.

You can use the Property Inspector to set this property:

As an alternative, use the set command to set the property in the UI code file.
For example, if there is a push button in your UI and its handle is stored in the
pushbutton1 field of the handles structure, then the statement
set(handles.pushbutton1,'FontName','default')

sets the FontName property to use the system default.
Free download pdf