Answers for "how to get fonts in tkinter"

1

script to see what tkinter fonts installed on system

import sys
if sys.version_info.major == 3:
    import tkinter as tk, tkinter.font as tk_font
else:
    import Tkinter as tk, tkFont as tk_font
root = tk.Tk()
print(tk_font.families())
print(tk_font.names())
Posted by: Guest on August-05-2021
1

font in tkinter

import tkinter.font as TkFont

font = tkFont.Font ( option, ... )
# Exaple
helv36 = tkFont.Font(family="Helvetica",size=36,weight="bold")
Posted by: Guest on November-02-2020

Python Answers by Framework

Browse Popular Code Answers by Language