tkFont (version 0.9)
index
/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/lib-tk/tkFont.py
Module Docs

# Tkinter font wrapper
#
# written by Fredrik Lundh, February 1998
#
# FIXME: should add 'displayof' option where relevant (actual, families,
#        measure, and metrics)
#

 
Modules
       
Tkinter

 
Classes
       
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.

 
Functions
       
families(root=None)
Get font families (as a tuple)
names(root=None)
Get names of defined fonts (as a tuple)
nametofont(name)
Given the name of a tk named font, returns a Font representation.

 
Data
        BOLD = 'bold'
ITALIC = 'italic'
NORMAL = 'normal'
ROMAN = 'roman'
__version__ = '0.9'