This is machine translation

Translated by Microsoft
Mouseover text to see original. Click the button below to return to the English version of the page.

Note: This page has been translated by MathWorks. Click here to see
To view all translated materials including this page, select Country from the country navigator on the bottom of this page.

listfonts

List available system fonts

Syntax

d = listfonts
d = listfonts(obj)

Description

example

d = listfonts returns an alphabetically sorted list of available system fonts.

example

d = listfonts(obj) returns available system fonts and includes the font name of the specified graphics object, if the object has FontName as a property.

Examples

collapse all

Call the listfonts function to return the list of available system fonts, with output similar in format to the one shown below.

d = listfonts
d =
    {'Agency FB'                      }
    {'Algerian'                       }
    {'Arial'                          }
    ... 
    {'Yu Gothic UI Semilight'         }
    {'ZapfChancery'                   }
    {'ZapfDingbats'                   }    

Specify a UIControl object as the input argument for the listfonts function. The value of the FontName property for the object is included in the sorted list.

c = uicontrol('Style','text','String','My Text','FontName','MyFont');
d = listfonts(c)
 d =
    {'Agency FB'                      }
    {'Algerian'                       }
    {'Arial'                          }
    ... 
    {'MyFont'                         }
    ... 
    {'Yu Gothic UI Semilight'         }
    {'ZapfChancery'                   }
    {'ZapfDingbats'                   }

Input Arguments

collapse all

Graphics object, such as an Axes, Text, Panel, ButtonGroup, Table, or UIControl object.

Tips

  • Some system fonts can't be rendered in MATLAB®. To preview fonts that MATLAB can render in figure windows, use the uisetfont function. Alternatively, in the Environment section of the Home tab, select Preferences > Fonts > Custom to preview the available fonts that MATLAB can render.

  • To determine an object's font name only, use dot notation to query the value of its FontName property.

See Also

Introduced in R2007a