[Tkinter-discuss] From wxPython to TK

Tim Jones timj at tolisgroup.com
Thu Mar 19 17:19:21 CET 2009

On Mar 19, 2009, at 8:51 AM, Tim Jones wrote:

> ...be aware that ANY cross-platform toolkit is going to see  
> problems with the DPI setting differences between Windows (72 DPI  
> default) and Linux X11 (72 to 99 DPI default).  You really need to  
> create your widgets in such a manner that things can be scaled  
> based on your determination of the system's current DPI value.
> You can get the DPI value on Linux using "xdpyinfo | grep  
> resolution" in a terminal.

I guess I should have reinforced that this is true for TCL/TK, Python/ 
Tkinter, and any other cross-platform framework.  And, it's gotten  
worse on Linux over the last year or so as the distros have started  
to try harder to make their default installs look better under GNOME  
or KDE.

It gets really troublesome when you're running Linux in a virtual  
machine on Windows as the DPMI responses to the X11 server are  
spotty.  I've seen DPI values from 88 to 173 returned.  While 88 is  
not too bad (the fonts get smaller), at 173, 10 point Helvetica is  
similar in physical size on the display as a 48 point font in Windows.

So, you may want to carefully examine your code if you are working  
towards Windows and X11 (and OS X) support as the DPI values can  
torpedo your work.


More information about the Tkinter-discuss mailing list