Documentation

listfonts

List available system fonts

Syntax

c = listfonts
c = listfonts(h)

Description

c = listfontsreturns sorted list of available system fonts.

c = listfonts(h)returns sorted list of available system fonts and includes theFontNameproperty of the object with handleh.

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 theFontNameproperty, for the object with handleh,包括和排序的列表中。

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

Tips

Callinglistfontsreturns a list of all fonts on your system, possibly including fonts that you cannot use with MATLAB®.Consider using theuisetfontfunction to preview fonts that MATLAB can render in figure windows. Likeuisetfont,Custompane under theFontssection of MATLAB Preferences also previews available fonts and only shows those that MATLAB can render.

See Also

Was this topic helpful?