| |
- Font
class Font |
|
Represents a named font.
Constructor options are:
font -- font specifier (name, system font, or (family, size, style)-tuple)
name -- name to use for this font configuration (defaults to a unique name)
exists -- does a named font by this name already exist?
Creates a new named font if False, points to the existing font if True.
Raises _Tkinter.TclError if the assertion is false.
the following are ignored if font is specified:
family -- font 'family', e.g. Courier, Times, Helvetica
size -- font size in points
weight -- font thickness: NORMAL, BOLD
slant -- font slant: ROMAN, ITALIC
underline -- font underlining: false (0), true (1)
overstrike -- font strikeout: false (0), true (1) |
|
Methods defined here:
- __del__(self)
- __eq__(self, other)
- __getitem__(self, key)
- __init__(self, root=None, font=None, name=None, exists=False, **options)
- __setitem__(self, key, value)
- __str__(self)
- actual(self, option=None)
- Return actual font attributes
- cget(self, option)
- Get font attribute
- config(self, **options)
- Modify font attributes
- configure = config(self, **options)
- copy(self)
- Return a distinct copy of the current font
- measure(self, text)
- Return text width
- metrics(self, *options)
- Return font metrics.
For best performance, create a dummy widget
using this font before calling this method.
| |