Main Content

Change Desktop Fonts

You can change the font size, name, and style used by tools in MATLAB®. You also can install new fonts to use with MATLAB.

Zoom

You can change the zoom level in the Editor, Live Editor, and Help browser. To zoom in and out, hold the Ctrl key and move the scroll wheel. On macOS systems, use the Command key instead.

Alternatively, you can zoom in and out using the available keyboard shortcuts.

ActionKeyboard Shortcut

Zoom in

Ctrl+Plus

On macOS systems, use Command+Shift+Plus.

Zoom out

Ctrl+Minus

On macOS systems, use Command+Shift+Minus.

Reset Zoom

(Not supported in Help browser)

Ctrl+Alt+0

On macOS systems, use Command+Alt+0.

Alternatively, you can change the zoom level in the Editor and Live Editor by going to the View tab and selecting Zoom In, Zoom Out, or Reset Zoom.

In MATLAB Online™, to change the zoom level, adjust the zoom settings for your web browser.

Change Font Size

You can change the font size in MATLAB using preferences or settings. This table describes how to change the font size for each tool.

ToolProcedure

Live Editor

Specify the font size for code and text programmatically using settings. For more information, see matlab.fonts Settings.

Code tools

  • Editor

  • Command Window

  • Command History

Specify the font size using font preferences.

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

Specify the font size using font preferences.

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 check box. Then, select a font size.

Charts

See Add Title and Axis Labels to Chart.

In MATLAB Online, you only can change the font size for the Editor (using font preferences) and the Live Editor (using settings).

Change Font Name and Style

You can change the font name and style in MATLAB using several different methods, depending on the tool. This table describes how to change the font name and style for each tool in MATLAB.

ToolProcedure

Live Editor

Specify the font name and style for code and text programmatically using settings. For example, this code changes the font name and style of normal text in the Live Editor.

s = settings;
s.matlab.fonts.editor.normal.Name.PersonalValue = 'Calibri';
s.matlab.fonts.editor.normal.Style.PersonalValue = {'bold'};
For more information, see matlab.fonts Settings.

Code tools

  • Editor

  • Command Window

  • Command History

Specify the font name and style using font preferences.

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 to monospaced to preserve vertical alignment. When the font is set to monospaced, the actual displayed font in the Editor is different than the font displayed in the Command Window and Command History. This is because monospaced is a logical font, not a physical font. To avoid this discrepancy, specify the font name as a physical font, for example, Courier New.

Text-based tools

  • Current Folder browser

  • Workspace browser

  • Variables editor

Specify the font name and style using font preferences.

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 check box. 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.

In MATLAB Online, you only can change the font name and font style for the Editor (using font preferences) and the Live Editor (using settings).

To apply antialiasing and create a smoother desktop appearance on Linux® systems, select Use antialiasing to smooth desktop fonts. You must restart MATLAB for the preference to take effect. On Microsoft® Windows® and macOS 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. To change the font preferences, on the Home tab, in the Environment section, click Preferences. Select MATLAB > Fonts > Custom and choose a tool from the list of Desktop tools. Then, select the font to use:

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

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

  • Custom — Select this option to specify a custom font for this tool. Then, specify a font name, style, and size. Some options are not supported for all tools.

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.

Setting custom font preferences is not supported for the Live Editor. To change the font name and style of code and text in the Live Editor, using settings. For more information, see matlab.fonts Settings.

Default Font Preferences

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

Tool

Font to Use

Default Font

Command History

Desktop code

Monospaced, plain, 10 point

When the font is set to monospaced, the actual displayed font in the Editor is different than the font displayed in the Command Window and Command History. This is because monospaced is a logical font, not a physical font. To avoid this discrepancy, specify the font name as a physical font, for example, Courier New.

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

Sans serif, plain, 10 point

Add New Font

You can install new fonts to use with MATLAB. 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.

Choose a new font that is compatible with MATLAB. 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

Install your new font in a location where MATLAB looks for fonts. 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

If you install a font with MATLAB running, restart MATLAB to include the font in the font preferences.

Then, to use the new font, follow the instructions in Change Font Name and Style.

See Also

Related Topics