gpt4 book ai didi

python - 不寻常的 tkinter 字体

转载 作者:行者123 更新时间:2023-11-30 22:05:21 27 4
gpt4 key购买 nike

tkinter 通常提供 Times New Roman、Arial 或 Calibri 等字体。但是,当我打印系统上可用的字体系列时,我得到以下输出:

('fangsong ti', 'fixed', 'clearlyu alternate glyphs', 'courier 10 pitch', 'open look glyph', 'bitstream charter', 'song ti', 'open look cursor', 'newspaper', 'clearlyu ligature', 'mincho', 'clearlyu devangari extra', 'clearlyu pua', 'clearlyu', 'clean', 'nil', 'clearlyu arabic', 'clearlyu devanagari', 'gothic', 'clearlyu arabic extra')

我更新了所有可能的包和库,但似乎没有任何内容可以更新此可用字体列表。

如何更新此列表以获得常用字体,或者如何手动将字体添加到 tkinter?

最佳答案

Tkinter 不保证您可以访问 Times New RomanArialCalibri。它只是让您可以访问系统上拥有的任何字体。安装字体的方式取决于您的系统。没有办法只为 tkinter 安装字体。

tk 文档中关于字体的唯一说明是这个1:

Tk guarantees to support the font families named Courier (a monospaced “typewriter” font), Times (a serifed “newspaper” font), and Helvetica (a sans-serif “European” font). The most closely matching native font family will automatically be substituted when one of the above font families is used.

<小时/>

1 http://tcl.tk/man/tcl8.5/TkCmd/font.htm

关于python - 不寻常的 tkinter 字体,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/53042505/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com