Module tkFont :: Class Font
[hide private]
[frames] | no frames]

_ClassType 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)

Instance Methods [hide private]
_set(self, kw)
_get(self, args)
_mkdict(self, args)
__init__(self, root=None, font=None, name=None, exists=False, **options)
__eq__(self, other)
__getitem__(self, key)
__setitem__(self, key, value)
Return a distinct copy of the current font
actual(self, option=None)
Return actual font attributes
cget(self, option)
Get font attribute
config(self, **options)
Modify font attributes
configure(self, **options)
Modify font attributes
measure(self, text)
Return text width
metrics(self, *options)
Return font metrics.
Method Details [hide private]

metrics(self, *options)


Return font metrics.

For best performance, create a dummy widget using this font before calling this method.