[Tkinter-discuss] Text widget, fonts, on OS X: questions and thoughts

Jason Harper JasonHarper at pobox.com
Tue Mar 30 04:28:13 EST 2004

> I am trying to change the font associated with a tag in a Text
> widget. Since there is no "direct" way (that I can see) to do this in
> Tkinter, 

Sure there is... I haven't actually changed a tag's font, but this works
for all of the other tag attributes I've tried:

	mytext.tag_config(mytag, foreground="RED", justify=RIGHT)

> tag configure mytag font { -family system -size 10 }

I think "system" is a Mac-specific special font identifier that implies
a size (and other attributes), not just a family.  Try an actual font
family name there, and you should have better luck changing the size.

> I'm finding
> myself wrapping a lot of things (font will be one) in Python
> classes to (almost completely) hide their Tkness,

There already is a Python wrapper for fonts - import tkFont.
	Jason Harper

More information about the Tkinter-discuss mailing list