Zoom and Change Desktop Fonts
You can change the zoom level, 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.
Action | Keyboard 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.
Tool | Procedure |
---|---|
Live Editor | Specify the font size for code and text programmatically using settings. For example, this code changes the code font size in the Live Editor. s = settings; s.matlab.fonts.editor.code.Size.TemporaryValue = '26pt' |
Code tools
| Specify the font size using font preferences. On the Home tab, in the Environment section, click
|
Text-based tools
| Specify the font size using font preferences. On the Home tab, in the Environment section, click
|
Charts | See Add Title and Axis Labels to Chart. |
In MATLAB Online, to change the font size, in the Preferences window, go to MATLAB > Appearance > Fonts. Changing the font size is only supported for the Editor, Live Editor, Command Window, and Command History.
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.
Tool | Procedure |
---|---|
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'}; |
Code tools
| Specify the font name and style using font preferences. On the Home tab, in the Environment section, click
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, |
Text-based tools
| Specify the font name and style using font preferences. On the Home tab, in the Environment section, click
|
Help Browser MATLAB web browser | Changing the font name and style is not supported. |
In MATLAB Online, to change the font name and font style, in the Preferences window, go to MATLAB > Appearance > Fonts. Changing the font size is only supported for the Editor, Live Editor, Command Window, and Command History.
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.
In MATLAB Online, setting custom font preferences is only supported for the Editor, Command Window, and Command History.
To change the font name and style of code and text for the Live Editor, use 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, |
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
, andtext
, 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.