Change Fonts

Change Font Size

Changing the font size in MATLAB® depends on the tool. This table describes how to change the font size for each tool in MATLAB.

To change the font size for charts, see Add Title and Axis Labels to Chart.

ToolProcedure

Live Editor

Use the Ctrl + Plus (+) and Ctrl + Minus (-) keyboard shortcuts.

Code tools

  • Editor

  • Command Window

  • Command History

On the Home tab, in the Environment section, click Preferences. Select MATLAB > Fonts and in the Desktop code font section, select a font size.

Text-based tools

  • Current Folder browser

  • Workspace browser

  • Variables editor

On the Home tab, in the Environment section, click Preferences. Select MATLAB > Fonts and in the Desktop text font section, clear the Use system font option. Then, select a font size.

Help Browser

MATLAB web browser

Use the Ctrl + Plus (+) and Ctrl + Minus (-) keyboard shortcuts.

Change Font Name and Style

Changing the font name and style in MATLAB depends on the tool. This table describes how to change the font name and style for each tool in MATLAB.

ToolProcedure

Live Editor

Changing the font name and style is not supported.

Code tools

  • Editor

  • Command Window

  • Command History

On the Home tab, in the Environment section, click Preferences. Select MATLAB > Fonts and in the Desktop code font section, select a font name and style. By default, the code font is set monospaced to preserve vertical alignment.

Text-based tools

  • Current Folder browser

  • Workspace browser

  • Variables editor

On the Home tab, in the Environment section, click Preferences. Select MATLAB > Fonts and in the Desktop text font section, clear the Use system font option. Then select a font name and style. By default, the text font is set to your system font.

Help Browser

MATLAB web browser

Changing the font name and style is not supported.

On UNIX® systems, select Use antialiasing to smooth desktop fonts to apply antialiasing and create a smoother desktop appearance. You must restart MATLAB for the preference to take effect. On Microsoft® Windows® and Macintosh platforms, MATLAB uses system setting for antialiasing.

Advanced Customization

You can further customize fonts in MATLAB by changing the font preferences for an individual tool. On the Home tab, in the Environment section, click Preferences. Select MATLAB > Fonts > Custom. Then, select a tool from the list of Desktop tools and specify the Fonts to use:

  • Desktop code — Specify this option to use the desktop code font for this tool.

  • Desktop text — Specify this option to use the desktop text font for this tool.

  • Custom — Specify this option to specify a custom font for this tool. Then, specify a font name, style, and size.

For example, to change the Editor font to a custom font, in the list of Desktop tools, select Editor. Then, in the Font to use section, select Custom and specify the desired font name, style, and size.

Some tools, such as the Profiler, use a custom font by default.

Note

For the Profiler, you can change the font type and size, but not the style (for example, bold or italic).

This table shows the default font preferences for tools in MATLAB. Use this table to restore fonts to their original state.

Tool

Font to Use

Default Font

Command History

Desktop code

Monospaced, Plain, 10 point

Command Window

Editor (and Shortcuts Editor)

Current Folder browser (and Path browser)

Desktop text

Your system's current font

Workspace browser

Variables editor

Function Browser

Profiler

Custom

SansSerif, Plain, 10 point

Adding Fonts

MATLAB determines the set the fonts used in font preferences from the fonts installed on your system. MATLAB looks for fonts in these locations:

  • The operating system's standard location (see your system administrator for details)

  • The /jre/lib/fonts folder where Java® software is installed on your system

MATLAB only includes compatible fonts in the font preferences.

  • For desktop components (such as the Command Window), figure windows, and uicontrols, fonts must be compatible with TrueType and Microsoft OpenType® fonts

  • For graphics objects, such as xlabel, ylabel, title, and text, fonts must be TrueType and Microsoft OpenType fonts

If you install a font with MATLAB running, restart MATLAB to include the font in the font preferences. A common reason to install additional fonts is to read files created in different languages. For details on adding fonts to your system, refer to the documentation for your system.

Related Topics