Skip to content
Open
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 18 additions & 3 deletions Doc/library/tkinter.font.rst
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,16 @@ The different font weights and slants are:

.. method:: actual(option=None, displayof=None)

Return the attributes of the font.
Returns information about the actual attributes that are obtained when
the font is used on *displayof*; the values obtained may differ from
those given (and retrieved by :meth:`Font.cget`) due to
platform-dependent limitations (such as the availability of font
families and pointsizes). If *displayof* is omitted, it defaults to the
main window.

If *option* is specified, the value of just that attribute is returned;
if it is omitted, the return value is a dictionary of all the attributes
and their values. See above for a list of the possible attributes. [1]_
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This says "above" but the reference is to a separate page. Is "above" referencing the constructor's docs? If so, let's add a link to it.

Copy link
Contributor Author

@E-Paine E-Paine Sep 28, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The "above" is referring to "additional keyword options". The link is to give reasonable credit to the man page as the entirety of the actual docs is just a modified version of the content found there (though I'm open to a more clear way of showing this).


.. method:: cget(option)

Expand All @@ -59,7 +68,7 @@ The different font weights and slants are:

.. method:: copy()

Return new instance of the current font.
Return new instance of the current font with a different *name*.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice!


.. method:: measure(text, displayof=None)

Expand Down Expand Up @@ -93,4 +102,10 @@ The different font weights and slants are:

.. function:: nametofont(name)

Return a :class:`Font` representation of a tk named font.
Return a :class:`Font` representation of a tk named font.

References
----------

.. [1] Tk 8.6 font man page
https://www.tcl.tk/man/tcl8.6/TkCmd/font.htm#M5
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This will be very useful to many who wouldn't know where to find this otherwise!