]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
gh-86017: Document displayof for Font.actual() and clarify Font.copy() (GH-153288)
authorSerhiy Storchaka <storchaka@gmail.com>
Wed, 8 Jul 2026 12:00:15 +0000 (15:00 +0300)
committerGitHub <noreply@github.com>
Wed, 8 Jul 2026 12:00:15 +0000 (15:00 +0300)
Explain the displayof argument of tkinter.font.Font.actual() and describe
what Font.copy() returns, including for a wrapped font description.

Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
Doc/library/tkinter.font.rst

index 1ac7ac8e98d16622a58273cd059930051ffb15af..c1cab7802da3889117c924a0ca30544a7276e06e 100644 (file)
@@ -74,6 +74,8 @@ The different font weights and slants are:
       requested ones because of platform limitations.
       With no *option*, return a dictionary of all the attributes; if *option*
       is given, return the value of that single attribute.
+      The attributes are resolved on the display of the *displayof* widget,
+      or the main application window if it is not specified.
 
    .. method:: cget(option)
 
@@ -97,7 +99,11 @@ The different font weights and slants are:
 
    .. method:: copy()
 
-      Return new instance of the current font.
+      Return a distinct copy of the current font:
+      a new named font with the same attributes but a different name,
+      which can be reconfigured independently of the original.
+      If the current font wraps a font description,
+      the copy is instead a named font with its resolved attributes.
 
    .. method:: measure(text, displayof=None)