wx.FontEnumerator

Inheritance diagram for wx.FontEnumerator:



Description

wx.FontEnumerator enumerates either all available fonts on the system or only the ones with given attributes - either only fixed-width (suited for use in programs such as terminal emulators and the like) or the fonts available in the given encoding.

To do this, you just have to call one of EnumerateXXX() functions - either EnumerateFacenames or EnumerateEncodings and the corresponding callback (OnFacename or OnFontEncoding) will be called repeatedly until either all fonts satisfying the specified criteria are exhausted or the callback returns False.

Class API

Methods

__init__()
No docstrings available for this method.

EnumerateEncodings(font="")

Call OnFontEncoding for each encoding supported by the given font - or for each encoding supported by at least some font if font is not specified.

Parameters:

  • font (string)

Returns:

bool


EnumerateFacenames(encoding=wx.FONTENCODING_SYSTEM, fixedWidthOnly=False)

Call OnFacename for each font which supports given encoding (only if it is not wx.FONTENCODING_SYSTEM) and is of fixed width (if fixedWidthOnly is True).

Calling this function with default arguments will result in enumerating all fonts available on the system.

Parameters:

  • encoding (int)
  • fixedWidthOnly (bool)

Returns:

bool


GetEncodings()

Return array of strings containing all encodings found by EnumerateEncodings.


Returns:

list of strings


GetFacenames()

Return array of strings containing all facenames found by EnumerateFacenames.


Returns:

list of strings


IsValidFacename(facename)

Returns True if the given string is valid face name, i.e. it’s the face name of an installed font and it can safely be used with wx.Font.SetFaceName.

Parameters:

  • facename (string)

Returns:

bool