Back to index

python3.2  3.2.2
Classes | Functions | Variables
tkinter.font Namespace Reference

Classes

class  Font

Functions

def nametofont
def families
def names

Variables

string __version__ = "0.9"
string NORMAL = "normal"
string ROMAN = "roman"
string BOLD = "bold"
string ITALIC = "italic"
tuple root = tkinter.Tk()
tuple f = Font(family="times", size=30, weight=NORMAL)
tuple w = tkinter.Label(root, text="Hello, world", font=f)
tuple fb = Font(font=w["font"])

Function Documentation

def tkinter.font.families (   root = None)

Definition at line 167 of file font.py.

00167 
00168 def families(root=None):
00169     "Get font families (as a tuple)"
00170     if not root:
00171         root = tkinter._default_root
00172     return root.tk.splitlist(root.tk.call("font", "families"))

def tkinter.font.names (   root = None)

Definition at line 173 of file font.py.

00173 
00174 def names(root=None):
00175     "Get names of defined fonts (as a tuple)"
00176     if not root:
00177         root = tkinter._default_root
00178     return root.tk.splitlist(root.tk.call("font", "names"))
00179 
00180 # --------------------------------------------------------------------
00181 # test stuff

def tkinter.font.nametofont (   name)
Given the name of a tk named font, returns a Font representation.

Definition at line 19 of file font.py.

00019 
00020 def nametofont(name):
00021     """Given the name of a tk named font, returns a Font representation.
00022     """
00023     return Font(name=name, exists=True)


Variable Documentation

Definition at line 9 of file font.py.

Definition at line 16 of file font.py.

tuple tkinter.font.f = Font(family="times", size=30, weight=NORMAL)

Definition at line 187 of file font.py.

tuple tkinter.font.fb = Font(font=w["font"])

Definition at line 212 of file font.py.

Definition at line 17 of file font.py.

Definition at line 14 of file font.py.

Definition at line 15 of file font.py.

Definition at line 184 of file font.py.

tuple tkinter.font.w = tkinter.Label(root, text="Hello, world", font=f)

Definition at line 206 of file font.py.