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

Kenneth McDonald kmmcdonald at wisc.edu
Tue Mar 30 04:02:51 EST 2004


Hi all. 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, I'm (somewhat circuitously) doing something which should
according to my understanding of Tkinter and Tk, eventually result
in a call on the Tk side somewhat of the form:

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

(Not too sure about the quoting.) I don't make the call directly
(it gets built out of some more abstract structures I've implemented),
so it may be slightly different from what I've shown above--but it
does execute and it does result in a slightly different font being
displayed. Unfortunately, the "other" font is just barely smaller
than the "default" fault, and more to the point, none of the font
attributes--size, family, weight, slant--have any effect upon it.

Tomorrow is going to be devoted to solving this (hopefully not
all day), but before I got into it, I wanted to ask:

	1) Are there any known problems with using other
	fonts in the Text widget under OS X?

	2) Would anyone care to provide a short (2-4 line)
	snippet of Python code that they know correctly
	changes a tag's font?

Now, back to a subject that created a brief flurry of activity
a bit ago, but has since died down--but not in my mind! That's
the subject of Tkinter documentation. I have a plan in mind
for starting out, which I'll begin this week, hopefully, and
seek feedback from the mailing list as I start coming up with
things. However, as I do more work with Tkinter in general, and
with the Text widget in particular, I'm also coming to believe
that part of the "documentation" problem is in fact a problem of
multilingualism--even if Tkinter were beautifully documented
right now, it's still too close to the Tk level to be easily learned
and used but people who _don't_ want to learn Tk. I'm finding
myself wrapping a lot of things (font will be one) in Python
classes to (almost completely) hide their Tkness, and to add
functionality. Anyone interested in doing more of that sort of
thing? Do you think it's a good idea? And, does anyone
know the current maintainer of Tkinter, so I can contact them
and see if they'd be willing to include further code?

Thanks,
Ken




More information about the Tkinter-discuss mailing list