Tkinter의 위젯은 font('Font-Family', font-size)를 사용하여 지정할 수 있는 font-family 및 글꼴 크기와 같은 속성 및 속성을 지원합니다. 재산.
예시
다음 예에서는 font-family를 "Times New Roman"으로 정의하고 font-size를 "20"으로 정의하여 구성할 수 있는 텍스트 레이블을 만들었습니다.
#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() 출력
위의 코드를 실행하면 텍스트가 있는 창이나 프레임이 표시됩니다.
