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 Live Editor code font name to 'Times New Roman' (where the default is 'Monospaced').

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

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

matlab.fonts.editor.code

Live Editor code font name, specified as a character vector. To get the list of available system fonts, use the listfonts function.

Example: s.matlab.fonts.editor.code.Name.TemporaryValue = 'Arial'

Live Editor code font style, specified as 'plain', 'bold', 'italic', or ["bold,"italic"]. To specify bold italic text, use ["bold","italic"].

Example: s.matlab.fonts.editor.code.Style.TemporaryValue = 'bold'

Example: s.matlab.fonts.editor.code.Style.TemporaryValue = ["bold","italic"]

Live Editor code font size, specified as one of the following:

  • A positive integer representing the size of the font in points, in the range [0,100].

  • A string scalar or character vector representing the size of the font in points. The string scalar or character vector represents a number in the range [0,100] followed by 'pt'. For example, '15pt'.

  • A string scalar or character vector representing the size of the font in pixels. The string scalar or character vector represents a number in the range [0,133] followed by 'px'. For example, '30px'.

Example: s.matlab.fonts.editor.code.Size.TemporaryValue = '26px'

Example: s.matlab.fonts.editor.code.Size.TemporaryValue = '16pt'

Example: s.matlab.fonts.editor.code.Size.TemporaryValue = 12

Live Editor code font color, specified as a three-element vector or a four-element vector.

The first three elements in the vector specify the intensities of the red, green, and blue components of the color. The intensities must be in the range [0,255]; for example, [100 80 60].

If there is a fourth element, it specifies the transparency of the color. The transparency value must be in the range [0,1]. A value of 1 is fully opaque and 0 is completely transparent.

Example: s.matlab.fonts.editor.code.Color.TemporaryValue = [0 10 255]

Example: s.matlab.fonts.editor.code.Color.TemporaryValue = [255 100 0 .5]

matlab.fonts.editor.normal

Live Editor normal font name, specified as a character vector. To get the list of available system fonts, use the listfonts function.

Example: s.matlab.fonts.editor.normal.Name.TemporaryValue = 'Arial'

Live Editor normal font style, specified as 'plain', 'bold', 'italic', or ["bold,"italic"]. To specify bold italic text, use ["bold","italic"].

Example: s.matlab.fonts.editor.normal.Style.TemporaryValue = 'bold'

Example: s.matlab.fonts.editor.normal.Style.TemporaryValue = ["bold","italic"]

Live Editor normal font size, specified as one of the following:

  • A positive integer representing the size of the font in points, in the range [0,100].

  • A string scalar or character vector representing the size of the font in points. The string scalar or character vector represents a number in the range [0,100] followed by 'pt'. For example, '15pt'.

  • A string scalar or character vector representing the size of the font in pixels. The string scalar or character vector represents a number in the range [0,133] followed by 'px'. For example, '30px'.

Example: s.matlab.fonts.editor.normal.Size.TemporaryValue = '26px'

Example: s.matlab.fonts.editor.normal.Size.TemporaryValue = '16pt'

Example: s.matlab.fonts.editor.normal.Size.TemporaryValue = 12

Live Editor normal font color, specified as a three-element vector or a four-element vector.

The first three elements in the vector specify the intensities of the red, green, and blue components of the color. The intensities must be in the range [0,255]; for example, [100 80 60].

If there is a fourth element, it specifies the transparency of the color. The transparency value must be in the range [0,1]. A value of 1 is fully opaque and 0 is completely transparent.

Example: s.matlab.fonts.editor.normal.Color.TemporaryValue = [0 10 255]

Example: s.matlab.fonts.editor.normal.Color.TemporaryValue = [255 100 0 .5]

matlab.fonts.editor.heading1

Live Editor heading 1 font name, specified as a character vector. To get the list of available system fonts, use the listfonts function.

Example: s.matlab.fonts.editor.heading1.Name.TemporaryValue = 'Arial'

Live Editor heading 1 font style, specified as 'plain', 'bold', 'italic', or ["bold,"italic"]. To specify bold italic text, use ["bold","italic"].

Example: s.matlab.fonts.editor.heading1.Style.TemporaryValue = 'bold'

Example: s.matlab.fonts.editor.heading1.Style.TemporaryValue = ["bold","italic"]

Live Editor heading 1 font size, specified as one of the following:

  • A positive integer representing the size of the font in points, in the range [0,100].

  • A string scalar or character vector representing the size of the font in points. The string scalar or character vector represents a number in the range [0,100] followed by 'pt'. For example, '15pt'.

  • A string scalar or character vector representing the size of the font in pixels. The string scalar or character vector represents a number in the range [0,133] followed by 'px'. For example, '30px'.

Example: s.matlab.fonts.editor.heading1.Size.TemporaryValue = '26px'

Example: s.matlab.fonts.editor.heading1.Size.TemporaryValue = '16pt'

Example: s.matlab.fonts.editor.heading1.Size.TemporaryValue = 12

Live Editor heading 1 font color, specified as a three-element vector or a four-element vector.

The first three elements in the vector specify the intensities of the red, green, and blue components of the color. The intensities must be in the range [0,255]; for example, [100 80 60].

If there is a fourth element, it specifies the transparency of the color. The transparency value must be in the range [0,1]. A value of 1 is fully opaque and 0 is completely transparent.

Example: s.matlab.fonts.editor.heading1.Color.TemporaryValue = [0 10 255]

Example: s.matlab.fonts.editor.heading1.Color.TemporaryValue = [255 100 0 .5]

matlab.fonts.editor.heading2

Live Editor heading 2 font name, specified as a character vector. To get the list of available system fonts, use the listfonts function.

Example: s.matlab.fonts.editor.heading2.Name.TemporaryValue = 'Arial'

Live Editor heading 2 font style, specified as 'plain', 'bold', 'italic', or ["bold,"italic"]. To specify bold italic text, use ["bold","italic"].

Example: s.matlab.fonts.editor.heading2.Style.TemporaryValue = 'bold'

Example: s.matlab.fonts.editor.heading2.Style.TemporaryValue = ["bold","italic"]

Live Editor heading 2 font size, specified as one of the following:

  • A positive integer representing the size of the font in points, in the range [0,100].

  • A string scalar or character vector representing the size of the font in points. The string scalar or character vector represents a number in the range [0,100] followed by 'pt'. For example, '15pt'.

  • A string scalar or character vector representing the size of the font in pixels. The string scalar or character vector represents a number in the range [0,133] followed by 'px'. For example, '30px'.

Example: s.matlab.fonts.editor.heading2.Size.TemporaryValue = '26px'

Example: s.matlab.fonts.editor.heading2.Size.TemporaryValue = '16pt'

Example: s.matlab.fonts.editor.heading2.Size.TemporaryValue = 12

Live Editor heading 2 font color, specified as a three-element vector or a four-element vector.

The first three elements in the vector specify the intensities of the red, green, and blue components of the color. The intensities must be in the range [0,255]; for example, [100 80 60].

If there is a fourth element, it specifies the transparency of the color. The transparency value must be in the range [0,1]. A value of 1 is fully opaque and 0 is completely transparent.

Example: s.matlab.fonts.editor.heading2.Color.TemporaryValue = [0 10 255]

Example: s.matlab.fonts.editor.heading2.Color.TemporaryValue = [255 100 0 .5]

matlab.fonts.editor.heading3

Live Editor heading 3 font name, specified as a character vector. To get the list of available system fonts, use the listfonts function.

Example: s.matlab.fonts.editor.heading3.Name.TemporaryValue = 'Arial'

Live Editor heading 3 font style, specified as 'plain', 'bold', 'italic', or ["bold,"italic"]. To specify bold italic text, use ["bold","italic"].

Example: s.matlab.fonts.editor.heading3.Style.TemporaryValue = 'bold'

Example: s.matlab.fonts.editor.heading3.Style.TemporaryValue = ["bold","italic"]

Live Editor heading 3 font size, specified as one of the following:

  • A positive integer representing the size of the font in points, in the range [0,100].

  • A string scalar or character vector representing the size of the font in points. The string scalar or character vector represents a number in the range [0,100] followed by 'pt'. For example, '15pt'.

  • A string scalar or character vector representing the size of the font in pixels. The string scalar or character vector represents a number in the range [0,133] followed by 'px'. For example, '30px'.

Example: s.matlab.fonts.editor.heading3.Size.TemporaryValue = '26px'

Example: s.matlab.fonts.editor.heading3.Size.TemporaryValue = '16pt'

Example: s.matlab.fonts.editor.heading3.Size.TemporaryValue = 12

Live Editor heading 3 font color, specified as a three-element vector or a four-element vector.

The first three elements in the vector specify the intensities of the red, green, and blue components of the color. The intensities must be in the range [0,255]; for example, [100 80 60].

If there is a fourth element, it specifies the transparency of the color. The transparency value must be in the range [0,1]. A value of 1 is fully opaque and 0 is completely transparent.

Example: s.matlab.fonts.editor.heading3.Color.TemporaryValue = [0 10 255]

Example: s.matlab.fonts.editor.heading3.Color.TemporaryValue = [255 100 0 .5]

matlab.fonts.editor.title

Live Editor title font name, specified as a character vector. To get the list of available system fonts, use the listfonts function.

Example: s.matlab.fonts.editor.title.Name.TemporaryValue = 'Arial'

Live Editor title font style, specified as 'plain', 'bold', 'italic', or ["bold,"italic"]. To specify bold italic text, use ["bold","italic"].

Example: s.matlab.fonts.editor.title.Style.TemporaryValue = 'bold'

Example: s.matlab.fonts.editor.title.Style.TemporaryValue = ["bold","italic"]

Live Editor title font size, specified as one of the following:

  • A positive integer representing the size of the font in points, in the range [0,100].

  • A string scalar or character vector representing the size of the font in points. The string scalar or character vector represents a number in the range [0,100] followed by 'pt'. For example, '15pt'.

  • A string scalar or character vector representing the size of the font in pixels. The string scalar or character vector represents a number in the range [0,133] followed by 'px'. For example, '30px'.

Example: s.matlab.fonts.editor.title.Size.TemporaryValue = '26px'

Example: s.matlab.fonts.editor.title.Size.TemporaryValue = '16pt'

Example: s.matlab.fonts.editor.title.Size.TemporaryValue = 12

Live Editor title font color, specified as a three-element vector or a four-element vector.

The first three elements in the vector specify the intensities of the red, green, and blue components of the color. The intensities must be in the range [0,255]; for example, [100 80 60].

If there is a fourth element, it specifies the transparency of the color. The transparency value must be in the range [0,1]. A value of 1 is fully opaque and 0 is completely transparent.

Example: s.matlab.fonts.editor.title.Color.TemporaryValue = [0 10 255]

Example: s.matlab.fonts.editor.title.Color.TemporaryValue = [255 100 0 .5]

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. To get the list of available system fonts, use the listfonts function.

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

Version History

Introduced in R2018a