Discussion:
[Tkinter-discuss] Different fonts in 3.3?
Josef Eschgfaeller
2014-05-09 21:35:05 UTC
Permalink
Trying to pass from Python 3.1 to 3.3 I have
a problem with Tkinter: fonts (or spacings)
in 3.3 seem to be higher, so that after
instructions like

A=tkinter.Text(B,width=36,height=27,...)

the text widget requires more space than
before with 3.1. I have Mac OS X 10.6.8 and
call Python from a script using

#! /Library/Frameworks/Python.framework\
/Versions/3.x/bin/python3

It seems also that the letters are a bit uglier,
somewhat more compressed.

Thanks
Josef Eschgfaeller
Ned Deily
2014-05-10 19:30:42 UTC
Permalink
In article
<CAFBvUat=jAGWrPRr7XXfkPh2tshvnpWfXUHidT8B06XXGAkfZA at mail.gmail.com>,
Post by Josef Eschgfaeller
Trying to pass from Python 3.1 to 3.3 I have
a problem with Tkinter: fonts (or spacings)
in 3.3 seem to be higher, so that after
instructions like
A=tkinter.Text(B,width=36,height=27,...)
the text widget requires more space than
before with 3.1. I have Mac OS X 10.6.8 and
call Python from a script using
#! /Library/Frameworks/Python.framework\
/Versions/3.x/bin/python3
It seems also that the letters are a bit uglier,
somewhat more compressed.
Chances are that the difference is not in Python itself but in the
versions of Tk that the two Pythons are linked with. I wouldn't be
surprised to find that the 3.1 version is linked with Tk 8.4 and 3.3 is
with Tk 8.5. One way to check is:

$ otool -L $(python3.3 -c 'import _tkinter;print(_tkinter.__file__)')
/Library/Frameworks/Python.framework/Versions/3.4/lib/python3.4/lib-dynlo
ad/_tkinter.so:
/Library/Frameworks/Tcl.framework/Versions/8.5/Tcl (compatibility
version 8.5.0, current version 8.5.15)
/Library/Frameworks/Tk.framework/Versions/8.5/Tk (compatibility
version 8.5.0, current version 8.5.15)
/usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current
version 125.2.0)

If you are using the python.org 3.3, please be sure to follow the README
instructions to install a new version of Tcl/Tk 8.5 (like the ActiveTcl
one); the Apple-supplied system Tcl/Tk 8.5 in OS X 10.6 was new and very
buggy.
--
Ned Deily,
nad at acm.org
Josef Eschgfaeller
2014-05-14 22:22:11 UTC
Permalink
I wouldn't be surprised to find that the 3.1 version
is linked with Tk 8.4 and 3.3 is with Tk 8.5.
Yes. I find this with tkinter.Tcl().eval('info patchlevel')
which gives 8.4.19 and 8.5.15.
the Apple-supplied system Tcl/Tk 8.5
I installed today Python 3.4. But some time
ago I installed ActiveTcl 8.6, which in the
Frameworks directory is also Current.

Does this mean, that the new Python 3.4
has been installed with Apple's Tcl and
not with the ActiveTcl version?

Thanks
Josef Eschgfaeller
Ned Deily
2014-05-15 01:17:34 UTC
Permalink
In article
<CAFBvUashE79zjwjR+eGEXmApyFir2Pm4ucpfiPx3ppyfBCJ6_A at mail.gmail.com>,
Post by Josef Eschgfaeller
I installed today Python 3.4. But some time
ago I installed ActiveTcl 8.6, which in the
Frameworks directory is also Current.
Does this mean, that the new Python 3.4
has been installed with Apple's Tcl and
not with the ActiveTcl version?
Python builds link with a specific version of Tk. The python.org 64-bit
installers for OS X link with a framework Tk 8.5, like current ActiveTcl
8.5.x and the buggy Apple-supplied system Tk 8.5.x. You can install
both ActiveTcl 8.5.x and 8.6.x on OS X. The python.org Python will
automatically use the ActiveTcl 8.5 once it is installed.

More details here:

https://www.python.org/download/mac/tcltk/
--
Ned Deily,
nad at acm.org
Ned Deily
2014-05-15 01:22:04 UTC
Permalink
In article
<CAFBvUashE79zjwjR+eGEXmApyFir2Pm4ucpfiPx3ppyfBCJ6_A at mail.gmail.com>,
Post by Josef Eschgfaeller
Yes. I find this with tkinter.Tcl().eval('info patchlevel')
which gives 8.4.19 and 8.5.15.
Post by Ned Deily
the Apple-supplied system Tcl/Tk 8.5
I installed today Python 3.4. But some time
ago I installed ActiveTcl 8.6, which in the
Frameworks directory is also Current.
Does this mean, that the new Python 3.4
has been installed with Apple's Tcl and
not with the ActiveTcl version?
Ah, sorry, I overlooked the "8.5.15" above. That seems to indicate that
you've already installed ActiveTcl 8.5.15. The fact that you've
installed ActiveTcl 8.6.x, which changed the Current link in the Tcl and
Tk frameworks, has no effect on which version a particular Python
dynamically links to at run time. The Current link affects building
_tkinter, not running it.
--
Ned Deily,
nad at acm.org
Kevin Walzer
2014-05-15 01:42:09 UTC
Permalink
Post by Josef Eschgfaeller
I wouldn't be surprised to find that the 3.1 version
is linked with Tk 8.4 and 3.3 is with Tk 8.5.
Yes. I find this with tkinter.Tcl().eval('info patchlevel')
which gives 8.4.19 and 8.5.15.
the Apple-supplied system Tcl/Tk 8.5
I installed today Python 3.4. But some time
ago I installed ActiveTcl 8.6, which in the
Frameworks directory is also Current.
If I understand you correctly, you have Python 3.1 which is linked with
Tk 8.4, and you have just installed Python 3.4, which is linked with Tk
8.5, and you see a difference in the fonts?

The most likely reason for this is that Tk 8.4 is built on the
deprecated Carbon framework, which uses a deprecated font engine called
ATUSI. The version of Tk 8.5 that you are using is built on the Cocoa
framework, which uses the modern CoreText font rendering engine.

I'm not sure of all the low-level differences between CoreText and
ATUSI, but there may very well be some subtle differences in how they look.

I was also going to ask if you are running on a Retina Display, which
can affect text rendering, but that may not be relevant here.

--Kevin
--
Kevin Walzer
Code by Kevin/Mobile Code by Kevin
http://www.codebykevin.com
http://www.wtmobilesoftware.com
Josef Eschgfaeller
2014-05-15 18:32:02 UTC
Permalink
Post by Ned Deily
Ah, sorry, I overlooked the "8.5.15" above.
That seems to indicate that you've already installed
ActiveTcl 8.5.15. The fact that you've installed
ActiveTcl 8.6.x, which changed the Current link
in the Tcl and Tk frameworks, has no effect on
which version a particular Python dynamically links
to at run time. The Current link affects building
_tkinter, not running it.
This is not clear to me. I had previously installed
both Tcl 8.5 and 8.6. Yesterday I installed Python 3.4.
Why did it not choose Tcl 8.6?

Not a Tkinter question: My Python Current link
points still to 2.7. Has this any meaning?
Post by Ned Deily
The most likely reason for this is that Tk 8.4 is
built on the deprecated Carbon framework, which
uses a deprecated font engine called ATUSI.
The differences are shown in

felix.unife.it/++/tmp

My doubt is still, whether this Tk 8.5 is now
the right one. In that case I would simple change
the height of the text widgets. As you notice
in 8.5 there appears also a border on the
selected list element, which I do not like too
much, but it is not important.

Thanks
Josef Eschgfaeller
Ned Deily
2014-05-16 08:09:53 UTC
Permalink
In article
<CAFBvUasAOjMr-DcqZY9R=Qdoon6FyK-Qu8QPEKzyMnQiA80MqA at mail.gmail.com>,
Post by Josef Eschgfaeller
Post by Ned Deily
Ah, sorry, I overlooked the "8.5.15" above.
That seems to indicate that you've already installed
ActiveTcl 8.5.15. The fact that you've installed
ActiveTcl 8.6.x, which changed the Current link
in the Tcl and Tk frameworks, has no effect on
which version a particular Python dynamically links
to at run time. The Current link affects building
_tkinter, not running it.
This is not clear to me. I had previously installed
both Tcl 8.5 and 8.6. Yesterday I installed Python 3.4.
Why did it not choose Tcl 8.6?
Because Python's _tkinter C extension is built and linked with a
particular compatibility version of Tk, i.e, the major version of Tcl
and Tk are determined when Python itself is built, not when Python is
installed or run. Note the absolute path to the Tcl and Tk framework
shared libraries: they both have explicit "8.5" values and not
"Current".

$ otool -L $(/usr/local/bin/python3.4 -c 'import _tkinter;
print(_tkinter.__file__)')
/Library/Frameworks/Python.framework/Versions/3.4/lib/python3.4/lib-dynlo
ad/_tkinter.so:
/Library/Frameworks/Tcl.framework/Versions/8.5/Tcl (compatibility
version 8.5.0, current version 8.5.15)
/Library/Frameworks/Tk.framework/Versions/8.5/Tk (compatibility
version 8.5.0, current version 8.5.15)
/usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current
version 125.2.0)
Post by Josef Eschgfaeller
Not a Tkinter question: My Python Current link
points still to 2.7. Has this any meaning?
As far as I know, the only practical effect the value of Current has is
when you compile or link a C program which uses "-framework Python".
The various compiler and linker components that support '-framework"
will use the Current link in the selected framework. When the program
is linked, the resolved path to the framework shared library is embedded
in the linker output file (executable, bundle, etc) as seen above with
otool -L.
--
Ned Deily,
nad at acm.org
Loading...