Documentation Center

  • Trial Software
  • Product Updates
我们为许可用户提供了部分翻译好的中文文档。您只需登录便可查阅这些文档

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

expand 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 utility (a GUI) to preview fonts to use; it only displays fonts that MATLAB can render in figures and GUIs. 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?