[Tutor] Japanese Font question - Windows vs. Linux

John Fusco fusco_john at yahoo.com
Fri Oct 22 04:03:40 CEST 2004


I have a simple script that runs fine on Windows, but does not select 
the right fonts on Linux (Fedora core 2).  I have Japanese fonts on my 
Linux machine, but for some reason Tkinter doesn't seem to understand 
how to encode them.  Even if I select a Japanese capable font liike 
"Mincho", I get the right font, but not the right characters.

Does anyone know what I am missing?  Do I have to coerce Tkinter to map 
the fonts correctly?  Why don't I have to do this on Windows?  Here's a 
simple example.

from Tkinter import *;

def Hiragana(sound):
    return eval( r"u'\N{HIRAGANA LETTER " + sound + "}'" )

win = Tk();

for x in "AIUEO":
    b = Button(win,text=Hiragana(x))
    b.pack()

win.mainloop();


Thanks,

John


More information about the Tutor mailing list