如何找出 Turtle 中可用的字体?
我正在使用 python 的海龟模块并想要加载不同的字体。我读到乌龟使用 tkinter 的字体,但其中一些应该可用的字体实际上并不可用。有谁知道如何添加字体或获取可用字体列表?我特别想写阿拉伯语、希伯来语字体。
I'm working with python's turtle module and want to load different fonts. I've read that turtle uses tkinter's fonts but some of these fonts that should be available are in fact not. Does anyone know how I can add fonts or get a list of available ones? I would especially like to write arabic, hebrew fonts.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
试试这个来列出字体。
Turtle 基于
tkinter
,因此您列出了tkinter
字体。Try this to list fonts.
Turtle is based on
tkinter
, so you list thetkinter
fonts.要添加字体,请首先下载所需的字体并将其安装到您的系统上。
然后您可以在代码中使用此字体,如示例所示。
我希望它对您添加新字体有所帮助。
参考:如何在 Python Turtle 中使用自定义本地字体?
另外,您可以检查这个也出来了。
To add a font, first download the font you want and install it on your system.
Then you can use this font in your code as shown in the example.
I hope it helps you about adding a new font.
Reference: How can I use custom local fonts in Python Turtle?
Also, you can check this out too.