[Pythonmac-SIG] Problem with tkaqua Tkinter and some Kanji unicode values.

Paul Taka takaanna at hotmail.com
Tue Nov 30 08:30:31 CET 2004

Thank you very much for your detailed answer, and telling me how to list Tk 
font families.
I'll try that.

By the way, did you find an issue for this problem about displaying some 
And do you know some way to type Japanese with Mac IME into a Tk entry box?


>From: Read Roberts <rroberts at adobe.com>
>To: Paul Taka <takaanna at hotmail.com>
>CC: pythonmac-sig at python.org
>Subject: RE:[Pythonmac-SIG] Problem with tkaqua Tkinter and some Kanji 
>unicode values.
>Date: Mon, 29 Nov 2004 10:11:40 -0800
>It does not work this way. I had the same problem - I naively wrote:
>from Tkinter import *
>import tkFont
>root = Tk()
>font = tkFont .Font(root, font= "Hiragino Kaku Gothic W3". 12)
>and then discovered that I was still getting Lucida by checking the result 
>The issue is that many fonts offer an OpenType  name table name ID 1 
>"Family" name in several languages. Which one is used depends on how the  
>font manager is written and on the system language. Although I run on a US 
>English only system,  it is the Japanese font name that is used on Mac 
>OSX,. I feel this is an error  - the font manager should look at the system 
>script, and choose the matching name from the font name table. However, I 
>do think you cannot expect TK to match a font by any of the font names in 
>the font.
>The way I figured out which font name to use was to check the list of 
>available fonts by family name, using
>root = Tk()
>This lists the available fonts by family name, and gives you the family 
>name by which the font is known to tkFont..
>What I would really like is to be able to select the font by PostScript 
>name, but I haven't figured out how to do that yet. The mechanism of 
>(family, style) is all very well for a old TrueType fonts, but fails with a 
>popular OpenType font like Adobe Minion Pro, with 64 styles., or even an 
>old Type 1 font like Frutiger.
>- Read Roberts

More information about the Pythonmac-SIG mailing list