spyder.api.fonts#

Helper classes to get and set the fonts used in Spyder.

Classes

SpyderFontType()

Font types used in Spyder plugins and the entire application.

SpyderFontsMixin()

Mixin to get the different Spyder font types from our config system.

class spyder.api.fonts.SpyderFontType[source]#

Bases: object

Font types used in Spyder plugins and the entire application.

This enum is meant to be used to get the QFont object corresponding to each type. These are:

  • Monospace is used in the Editor, IPython Console and History panes

  • Interface is used by the entire Spyder application

  • MonospaceInterface is used, for instance, by the Variable Explorer and corresponds to the Monospace font resized to look good together with the Interface font.

Note

The values names in this enum are a result of historical reasons that date from Spyder 2 and are not easy to change now.

Monospace: str = 'font'#

Monospace font, used for code, output and literal/verbatim text.

Used in, for example, the Editor, IPython Console and History panes.

Interface: str = 'app_font'#

Interface font, used throughout the Spyder application.

MonospaceInterface: str = 'monospace_app_font'#

Monospace font resized to work with the Interface font.

Used, for instance, by the Variable Explorer and corresponds to the Monospace font resized to look good when used together with the Interface font.

class spyder.api.fonts.SpyderFontsMixin[source]#

Bases: object

Mixin to get the different Spyder font types from our config system.

classmethod get_font(font_type: str, font_size_delta: int = 0) QFont[source]#

Get a font type as a QFont object.

Parameters:
  • font_type (str) – A Spyder font type, one of the SpyderFontType enum values.

  • font_size_delta (int, optional) – Increase or decrease the default font size by this amount. The default is 0.