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.

Notes

  • This enum is meant to be used to get the QFont object corresponding to each type.

  • The names associated to the values in this enum depend on historical reasons that go back to Spyder 2 and are not easy to change now.

  • Monospace is the font used used in the Editor, IPython console and History; Interface is used by the entire Spyder app; and MonospaceInterface is used, for instance, by the Variable Explorer and corresponds to Monospace font resized to look good against the Interface one.

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 | None = 0) QFont[source]#

Get a font type as a QFont object.

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

  • font_size_delta (int, optional) – Small increase or decrease over the default font size. The default is 0.