我正在使用以下代码:
from tkinter import *
from tkinter.font import Font
root = Tk()
root.title("Font window")
root.geometry("500x500")
my_font = Font(
family = 'Helvetica',
size = 30,
weight = 'bold',
slant = 'roman',
underline = 1,
overstrike = 0
)
my_label = Label(root, text="Peter Pan", fg="Green", bg="White", font = my_font)
value = my_label.cget("text")
print(value)
my_label.pack()
root.mainloop()
这可行,但是如何获取字体系列值或字体大小值?