ภาพรวม
Widget ของ Tkinter รองรับ Property และ Attribute เช่น Font-family และ Font-size ระบุด้วย Property font('Font-Family', font-size)
ตัวอย่างโค้ด
# Import the tkinter library
from tkinter import *
# Create an instance of tkinter frame
win = Tk()
# Set the geometry
win.geometry("650x250")
# Add a text label and add the font property to it
label = Label(win, text="This is a New Text", font=('Times New Roman bold', 20))
label.pack(padx=10, pady=10)
win.mainloop()
ผลลัพธ์
รันโค้ดจะแสดงหน้าต่างหรือ Frame พร้อมข้อความ
