Documentation

listfonts

List available system fonts

Syntax

c = listfonts
c = listfonts(h)

Description

c = listfonts returns sorted list of available system fonts.

c = listfonts(h) returns sorted list of available system fonts and includes the FontName property of the object with handle h.

Examples

Example 1

This example returns a list of available system fonts similar in format to the one shown.

list = listfonts
list = 
    'Agency FB'
    'Algerian'
    'Arial'
    ...
    'ZapfChancery'
    'ZapfDingbats'
    'ZWAdobeF'

Example 2

This example returns a list of available system fonts with the value of the FontName property, for the object with handle h, included and sorted in the list.

 h = uicontrol('Style','text','String',...
     'My Font','FontName','MyFont');
 list = listfonts(h)
list = 
    'Agency FB'
    'Algerian'
    'Arial'
    ...
    'MyFont'
    ...
    'ZapfChancery'
    'ZapfDingbats'
    'ZWAdobeF'

More About

collapse all

Tips

Calling listfonts returns a list of all fonts on your system, possibly including fonts that you cannot use with MATLAB®. Consider using the uisetfont function to preview fonts to that MATLAB can render in figure windows. Like uisetfont, the Custom Fonts pane of MATLAB Preferences also previews available fonts and only shows those that MATLAB can render.

See Also

Was this topic helpful?