添加链接
link管理
链接快照平台
  • 输入网页链接,自动生成快照
  • 标签化管理网页链接
class tkinter.font. Font ( root = None , font = None , name = None , exists = False , ** options )

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

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 - 有删除线)
descent - 基线和最低点之间的距离

(在该字体中的一个字符可以占用的空间中)

linespace - 所需最小垂直间距(在两个

该字体的字符间,使得这两个字符在垂直方向上不重叠)。

fixed - 如果该字体宽度被固定则为1,否则为0。

2001-2024, Python Software Foundation. This page is licensed under the Python Software Foundation License Version 2. Examples, recipes, and other code in the documentation are additionally licensed under the Zero Clause BSD License. See History and License for more information.