]> git.ipfire.org Git - thirdparty/Python/cpython.git/commit
[3.13] gh-143990: Preserve the size when creating a Font from a named font (GH-153267...
authorMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>
Wed, 8 Jul 2026 13:22:24 +0000 (15:22 +0200)
committerGitHub <noreply@github.com>
Wed, 8 Jul 2026 13:22:24 +0000 (13:22 +0000)
commitd5e267791e97849fac0f6f3957390dd0e265abac
tree8a355411e4d81ce8c0e9b554d1bcda45d4bbed83
parent4a435e5f2ce29f4ffad714aef7a1c1103a1c13a7
[3.13] gh-143990: Preserve the size when creating a Font from a named font (GH-153267) (GH-153323) (GH-153342)

tkinter.font.Font now copies the options of a named font (via "font
configure") instead of the options resolved by "font actual", which
would resolve a size specified in pixels (a negative size) to points.
A font description is still resolved, as it cannot be parsed otherwise.

Font.copy(), which has always been equivalent to constructing a Font
from the original font, is updated to match and now preserves the size
too.

(cherry picked from commit 45010f441d392558f1be8f3cea7d86954ed2217d)
(cherry picked from commit a9d4473232f86d6dfc234756f633b8dc5836ad32)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
Lib/test/test_tkinter/test_font.py
Lib/tkinter/font.py
Misc/NEWS.d/next/Library/2026-07-07-17-50-54.gh-issue-143990.FoNtCf.rst [new file with mode: 0644]