问题
I want to use a font called Myriad Pro Condensed, which is installed on my computer.
If I use Label(infoframe, text="test", font=("Myriad Pro Condensed", 30, "bold"))
It just uses the default system font. Using just the family name Myriad Pro
works but it doesn't use the condensed version I want to use. How would I go about using the correct font in Tkinter?
Here's an MCVE:
from tkinter import *
root = Tk()
label = Label(root, text="test", font=("Myriad Pro Condensed"))
label.pack()
mainloop()
回答1:
Use font name:
Label(root, text="test",font=("MyriadPro-LightCond",size))
来源:https://stackoverflow.com/questions/35971184/designating-a-font-in-tkinter