Displaying IPA characters in Tkinter

Mickel Grönroos mickel at csc.fi
Tue Jun 17 03:23:46 EDT 2003


On Tue, 17 Jun 2003, Erik Max Francis wrote:

> There are IPA glyphs in Unicode, but I don't know whether Tkinter
> supports Unicode or not.
>
> If all else fails, there are ASCII forms of IPA that you could
> potentially use provided you had careful documentation.

Yes, I was planning on using worldbet as input format, but I would like to
display the data in an IPA font.

This is what I have so far:

------------------------------------------
import Tkinter
import tkFont

root = Tkinter.Tk()

## The following is gibberish
u_ipa = u"\u0250 \u0268 \N{LATIN SMALL LETTER TC DIGRAPH WITH CURL}"

## This font on my Redhat 7.0 seems to support IPA glyphs
font = tkFont.Font(root, family="clearlyu", size="24")

label1 = Tkinter.Label(root, text=u_ipa, font=font)
label1.pack()

root.mainloop()
------------------------------------------

So yes, Tkinter can show IPA glyphs on labels at least.

/Mickel

--
Mickel Grönroos, application specialist, linguistics, Research support, CSC
PL 405 (Tekniikantie 15 a D), 02101 Espoo, Finland, phone +358-9-4572237
CSC is the Finnish IT center for science, www.csc.fi






More information about the Python-list mailing list