Main Content

matlab.fonts Settings

Code font settings

The default font that MATLAB uses for a particular tool depends upon its content. You can change the default font using the matlab.fonts settings. Access matlab.fonts using the root SettingsGroup object returned by the settings function. For example, set the temporary value for the code font name to 'Times New Roman' (where the default is 'Monospaced').

s = settings;
s.matlab.fonts.codefont.Name.TemporaryValue = 'Times New Roman'

For more information about settings, see Access and Modify Settings.

matlab.fonts.codefont

Desktop code font name, specified as a character vector. This is the name of the font that displays for all code tools in the MATLAB® desktop.

Example: s.matlab.fonts.codefont.Name.TemporaryValue = 'Arial'

Desktop code font style, specified as the positive integer 0, 1, 2, or 3. This is the style of the font that displays for all code tools in the MATLAB desktop.

The values are defined as follows:

  • 0 — Plain

  • 1 — Bold

  • 2 — Italic

  • 3 — Bold Italic

Example: s.matlab.fonts.codefont.Style.TemporaryValue = 1

Desktop code font size, specified as a positive integer. This is the size of the font that displays for all code tools in the MATLAB desktop.

Example: s.matlab.fonts.codefont.Size.TemporaryValue = 12

matlab.fonts.editor.codefont

App designer code font size that displays in App Designer Code View, specified as a positive integer between 14 and 48.

Example: s.matlab.fonts.editor.codefont.Size.TemporaryValue = 20

Introduced in R2018a