]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
[3.15] gh-86017: Document displayof for Font.actual() and clarify Font.copy() (GH...
authorMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>
Wed, 8 Jul 2026 12:09:01 +0000 (14:09 +0200)
committerGitHub <noreply@github.com>
Wed, 8 Jul 2026 12:09:01 +0000 (12:09 +0000)
Explain the displayof argument of tkinter.font.Font.actual() and describe
what Font.copy() returns, including for a wrapped font description.
(cherry picked from commit fa5eafd19c3d395b4498e21b4e1b8faac2ebdb0a)

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

index 2a9563fffab1f7150c3aa53c33c4ac7de2edab6d..947207724ab04091db79ebf7b2d35fef87f3a093 100644 (file)
@@ -54,6 +54,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)
 
@@ -71,7 +73,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)