You can change the font size, name, and style used by tools in MATLAB®. You also can install new fonts to use with MATLAB.
You can change the font size in MATLAB using several different methods, depending on the tool. For some tools, you can specify the font size using preferences or settings. For other tools, you can increase and decrease the font size by zooming in and out. This table describes how to change the font size for each tool.
To change the font size for charts, see Add Title and Axis Labels to Chart.
| Tool | Procedure |
|---|---|
Live Editor | Zoom in or out using the Ctrl + Plus (+) and Ctrl + Minus (-) keyboard shortcuts or by holding Ctrl and scrolling with the mouse. On macOS systems, use the Command key instead of the Ctrl key. You also can specify the font size for code and text programmatically using settings. For more information, see matlab.fonts Settings. |
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
|
Help Browser MATLAB web browser | Zoom in or out using the Ctrl + Plus (+) and Ctrl + Minus (-) keyboard shortcuts or by holding Ctrl and scrolling with the mouse. On macOS systems, use the Command key instead of the Ctrl key. |
In MATLAB Online™, you only can change the font size for the Editor (using font preferences) and the Live Editor (using settings). To zoom in or out, adjust the zoom settings for your web browser.
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
|
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, 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.
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.
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 |
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 |
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.