]> git.ipfire.org Git - thirdparty/Python/cpython.git/commit
gh-143990: Preserve the size when creating a Font from a named font (GH-153267)
authorSerhiy Storchaka <storchaka@gmail.com>
Wed, 8 Jul 2026 08:30:12 +0000 (11:30 +0300)
committerGitHub <noreply@github.com>
Wed, 8 Jul 2026 08:30:12 +0000 (11:30 +0300)
commit45010f441d392558f1be8f3cea7d86954ed2217d
tree768b8d280f228e7339cd58ed72b4f6e62d252597
parent45729033bff28f8abc36c42e802cb2853c205737
gh-143990: Preserve the size when creating a Font from a named font (GH-153267)

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.

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]