1#How to change the font of a label in Tkinter
2
3#Import
4from tkinter import *
5
6#Screen
7window = Tk()
8window.title("New Window")
9window.geometry("300x250")
10
11Label(window, text = "This is my new project in python!", font = ("Bahnschrift", 14)).pack()
12#-------------------------------------------------------------------------------------------
13#'font' tells python that we are going to do something with the font
14#-------------------------------------------------------------------------------------------
15#'()' are needed becuase that is just how python works
16#-------------------------------------------------------------------------------------------
17#'"___"' put your font name in the quotes
18#-------------------------------------------------------------------------------------------
19#10 put vyour fontsize after adding a comma after the font name
20#-------------------------------------------------------------------------------------------
1import tkinter.font as font
2
3#create Font object
4myFont = font.Font(family='Helvetica')
5
6button = Button(parent, font=myFont)
7#or
8button = Button(parent)
9button['font'] = myFont
1import tkinter.font as TkFont
2
3font = tkFont.Font ( option, ... )
4# Exaple
5helv36 = tkFont.Font(family="Helvetica",size=36,weight="bold")