"tkinter.font" --- Tkinter 字体包装器
*************************************

**源代码:** Lib/tkinter/font.py

======================================================================

"tkinter.font" 模块提供了 "Font" 类，用于创建和使用命名字体。

不同的字体粗细和倾斜是：

tkinter.font.NORMAL
tkinter.font.BOLD
tkinter.font.ITALIC
tkinter.font.ROMAN

class tkinter.font.Font(root=None, font=None, name=None, exists=False, **options)

   "Font" 类表示命名字体。*Font* 实例具有唯一的名称，可以通过其族、大
   小和样式配置进行指定。命名字体是 Tk 将字体创建和标识为单个对象的方
   法，而不是通过每次出现时的属性来指定字体。

   在 3.10 版本发生变更: 现在两个字体相等 ("==") 的条件是两者都是
   "Font" 实例并且具有属于相同 Tcl 解释器的相同名称。参数：

         *font* - 字体指示符元组 (family, size, options)
         *name* - 唯一的字体名
         *exists* - 指向现有命名字体（如果有）

   其他关键字选项（如果指定了 *font*，则忽略）：

         *family* - 实体族，例如 Courier, Times
         *size* - 字体大小
            如果 *size* 为正数，则解释为以磅为单位的大小。
            如果 *size* 是负数，则将其绝对值
            解释为以像素为单位的大小。
         *weight* - 字体强调 (NORMAL, BOLD)（普通，加粗）
         *slant* - ROMAN, ITALIC（正体，斜体）
         *underline* - 字体下划线（0 - 无下划线，1 - 有下划线）
         *overstrike* - 字体删除线（0 - 无删除线，1 - 有删除线）

   actual(option=None, displayof=None)

      Return the actual attributes of the font, which may differ from
      the 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.

   cget(option)

      检索字体的某一个属性值。

   configure(**options)

      Modify one or more attributes of the font. With no arguments,
      return a dictionary of the current attributes.

      "config()" 是 "configure()" 的别名。

   copy()

      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.

   measure(text, displayof=None)

      Return amount of space the text would occupy on the specified
      display when formatted in the current font, as an integer number
      of pixels. If no display is specified then the main application
      window is assumed.

   metrics(*options, **kw)

      Return font-specific data. With no options, return a dictionary
      mapping each metric name to its integer value; if one option
      name is given, return that metric's value as an integer. Options
      include:

      *ascent* - 基线和最高点之间的距离
         （在该字体中的一个字符可以占用的空间中）

      *descent* - 基线和最低点之间的距离
         （在该字体中的一个字符可以占用的空间中）

      *linespace* - 所需最小垂直间距（在两个
         该字体的字符间，使得这两个字符在垂直方向上不重叠）。

      *fixed* - 如果该字体是等宽字体则为 1，否则为 0。

tkinter.font.families(root=None, displayof=None)

   Return a tuple of the names of the available font families.

tkinter.font.names(root=None)

   Return a tuple of the names of all the defined fonts.

tkinter.font.nametofont(name, root=None)

   Return a "Font" representation of the existing named font *name*.
   *root* is the widget whose Tcl interpreter owns the font; if
   omitted, the default root window is used.

   在 3.10 版本发生变更: 增加了 *root* 形参。
