-
-
Notifications
You must be signed in to change notification settings - Fork 31.9k
In linux, copying a tkinter font doubles its size when using Tk 8.6 and a hi-res screen. #128719
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
I think the doubling behavior is because tkinter's
On a high-res Linux screen with Ubuntu 24.04, the
This seems consistent with the Tk docs which say that
|
Also, on stock Ubuntu 24.04, I see a very different result from @culler's built-from-source Tk 8.6:
Note everything here is in points, not a mix of points and pixels. The same difference between config and actual shows up in user-defined fonts:
|
This is probably a difference between 8.6.14 and 8.6.15. There is now a release of 8.6.16. I will report if it differs from 8.6.15. |
Indeed! It looks like they ended up fixing a related Tk bug but never got to the tkinter issue raised in the original report, which seems to be the same as this one.. |
I installed the proposed Ubuntu package
|
I'm thinking maybe there's nothing to do here for
However, if Tk itself is working right, they should always display the same. Moreover,
whereas |
Bug report
Bug description:
The example above is from Ubuntu 24.04 running on an Asus Zenbook with EVO screen. The display scaling from the system settings is the default, namely 200%. This does not happen when the display scaling is 100%.
Note that font f1 is already (more than) doubled in size, compared to what wish8.6 (built from 8.6.15 source) reports:
The negative value -12 means that the size is 12 pixels, as opposed to 12 points. I think the intitial expansion being slightly more than a factor of 2 may be caused by rounding when converting pixels to points.
Note that the behavior of Tk 9 is different. Using wish9.0 on the same system produces:
Also, the pending new version of tkinter from #124156 does not have this doubling behavior when used with Tk 9.0. (I have not tested the new tkinter with Tk 8.6, but I expect it to have the broken behavior since I don't think that the PR changes Font.copy.)
CPython versions tested on:
3.12
Operating systems tested on:
Linux
The text was updated successfully, but these errors were encountered: