不寻常的tkinter字体

2024-10-01 00:16:50 发布

您现在位置:Python中文网/ 问答频道 /正文

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?在


Tags: 列表newtkinter系统字体tiopenextra
1条回答
网友
1楼 · 发布于 2024-10-01 00:16:50

Tkinter不保证您有权访问Times New RomanArial或{}。它只是让你访问你的系统上的任何字体。安装字体的方式取决于您的系统。没有办法只为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.


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

相关问题 更多 >