Idiots guide to fonts with tKinter

RangerElf gustavo.cordova at
Fri Aug 5 06:51:52 CEST 2005

Well, all text classes in Tkinter can take a " font=(...) " argument to
specify the face with which to display, for example:

from tkinter import *
label = Label(root, font=("Helvetica", "bold", 13), ...)

It's been a while since I've played with Tkinter, so I might be a
little off on the exact syntax, but that's the main idea.  It's really
simple once you get the hang of it.

Regarding the text editor: it's an excellent idea.  By using Tkinter's
text widget you can get a bit of milage easily; you'll have to define
and use "tags" in order to organize your text styles, it'll make
everything quite a bit easier.

You can glean a bunch of info from Idle's sources.

Good luck :-)


More information about the Python-list mailing list