Issue 12979: tkinter.font.Font object not usable as font option (original) (raw)
If a Font object is passed as a font option to a Tk widget e. g.:
import tkinter import tkinter.font
f = tkinter.font.Font(family='Arial', size=30) root = Tk() label = tkinter.Label(root, text="Hello", font=f) label.pack()
the font does not get respected at runtime.
The test from ilikepython is incorrect, but after changing to:
import tkinter import tkinter.font
root = tkinter.Tk() w = tkinter.Frame(root) f = tkinter.font.Font(root, family='Arial', size=30) label = tkinter.Label(w, text="Hello", font=f) label.pack() w.pack() root.mainloop()
it works.
Closing the issue.