Title: IDLE rendering issue with oriental characters on OSX
Type: Stage:
Components: IDLE, macOS, Tkinter Versions: Python 3.1, Python 2.7, Python 2.6
Status: closed Resolution: wont fix
Dependencies: Superseder:
Assigned To: Nosy List: ezio.melotti, ned.deily, ronaldoussoren
Priority: normal Keywords:

Created on 2009-05-26 06:49 by ronaldoussoren, last changed 2011-03-09 02:20 by ned.deily. This issue is now closed.

File name Uploaded Description Edit
Chinese.txt ronaldoussoren, 2009-05-26 14:48
Messages (7)
msg88331 - (view) Author: Ronald Oussoren (ronaldoussoren) * (Python committer) Date: 2009-05-26 06:49
IDLE has problems rendering some oriental characters on OSX.

One way to reproduce this:

* Start IDLE
* Open the "Preferences..." menu
* Scroll down in the list of fonts until you reach the 'Osaka' font

The font just below the Osaka font has a number of oriental characters 
in its name. Some of those characters are rendered as squares instead of 
the correct character.

The same problem crops up when you print oriental characters. I started 
looking into this because a user on the pythonmac-sig asked a question 
about this. I have a file that demonstrates the problem when you open 
it, but don't know yet if I can post that to the tracker.
msg88346 - (view) Author: Ezio Melotti (ezio.melotti) * (Python committer) Date: 2009-05-26 09:23
Are these characters displayed correctly in other places?

Usually characters that are not available in a specific font are
replaced by an empty box. In some cases the missing characters can be
borrowed by other fonts, but IIRC that depends on the application.

If you have a script or file that demonstrates the problem, attach it to
the issue (I don't have OSX to test it though).
msg88347 - (view) Author: Ronald Oussoren (ronaldoussoren) * (Python committer) Date: 2009-05-26 09:34
The same fontname and file display correctly in programs (such as 

Even when both textmate and IDLE have been configured to use the same 
font the text looks fine in textmate and broken in IDLE.

My gut feeling is that this is an issue with the Tk port to OSX. 

The same bad output is seen in the GUI version of wish when you read the 
file there manually using this code:

% open /Users/ronald/Desktop/Chinese.txt
% read file10

The output of the last statement also contains squares, and at the same 
positions as when I open the file in IDLE.

What I don't know is if there is some magical Tcl code that will fix 
this issue.
msg88362 - (view) Author: Ronald Oussoren (ronaldoussoren) * (Python committer) Date: 2009-05-26 14:48
The attached file is an example of text that works fine in Textmate but 
renders incorrectly in IDLE.
msg88363 - (view) Author: Ronald Oussoren (ronaldoussoren) * (Python committer) Date: 2009-05-26 15:01
This is definitly an Tk issue, the issue seems to be fixed in Tcl/Tk 8.5.

That is, when I install Tk 8.5 and rerun the Tcl scriptlet I posted 
earlier the problem goes away. I'm currently rebuilding a version of the 
tkinter extension that links to Tk 8.5 to check if that solves the problem 
in IDLE as well.
msg88364 - (view) Author: Ronald Oussoren (ronaldoussoren) * (Python committer) Date: 2009-05-26 15:13
Switching to Tcl/Tk 8.5 fixes the issue for IDLE as well.

I'm leaving this bug open for future reference, and because this affects 
the binary installer for python.

The big question: how to fix this in Python itself. I see the following 

1) Ignore the issue

2) Include Tcl/Tk 8.5 in the OSX installer

   I'm not to happy about this because this would bloat the OSX 
   installer even more and would probably not what heavy Tkinter users
   would like anyway.

3) Add 2 versions of to the installer: one linked to 
   Tcl 8.4 the other to Tcl 8.5, and automaticly load the right one
   when someone imports Tkinter.

   Then document that users should install a 3th-party Tk 8.5 to fix
   unicode issues.

4) Require Tk 8.5 on the users system.

   This last option is IMHO not acceptable, for better or worse IDLE
   is the most visible bit of the Python installation for new users and
   that should therefore work out of the box.
msg130398 - (view) Author: Ned Deily (ned.deily) * (Python committer) Date: 2011-03-09 02:20
For the record, as of Python 2.7 and 3.2, there *are* now two Python installers for OS X, one that continues to support Tk 8.4 on 10.3+ and one that supports 8.5 on 10.6+.  Caveats and details here:
Date User Action Args
2011-03-09 02:20:43ned.deilysetnosy: + ned.deily
messages: + msg130398
2009-06-01 21:19:48benjamin.petersonsetstatus: open -> closed
2009-05-26 15:13:31ronaldoussorensetresolution: wont fix
messages: + msg88364
2009-05-26 15:01:29ronaldoussorensetmessages: + msg88363
2009-05-26 14:48:48ronaldoussorensetfiles: + Chinese.txt

messages: + msg88362
2009-05-26 09:34:19ronaldoussorensetmessages: + msg88347
2009-05-26 09:23:10ezio.melottisetnosy: + ezio.melotti
messages: + msg88346
2009-05-26 06:49:58ronaldoussorencreate