【发布时间】:2021-03-20 04:37:03
【问题描述】:
如何获取 Tkinter 中可用字体的名称列表?
我尝试和使用的唯一字体是“Courier”和“Helvetica”,我尝试使用其他字体但它返回相同的默认字体。
# this works
button = tk.Button(self.subframe, text="quit", command=master.destroy,
highlightbackground='black', font='Helvectica 18')
# this does not work (the text remains the font)
button = tk.Button(self.subframe, text="quit", command=master.destroy,
highlightbackground='black', font='Roboto 18')
(font used in the second example)
所以我不知道哪些字体可用或不可用,如果我能得到字体列表会很有帮助。
【问题讨论】:
-
这能回答你的问题吗?:stackoverflow.com/questions/39614027/…