Python Forum
how to change font size
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
how to change font size
#5
To see the tkinter fonts you can do

import tkinter as tk
from tkinter import font
root = tk.Tk()
families = font.families()

tk.Label(root, text=f'tkinter has {len(families)} fonts available.', font=('serif', 14, 'bold')).pack(side='top')

scrollbar = tk.Scrollbar(root)
scrollbar.pack(side='right', fill='y')

text = tk.Text(root, width=75, yscrollcommand=scrollbar.set)
for font_name in families:
    text.insert(tk.END, f'{font_name}\n')
scrollbar.config(command=text.yview)
text.pack(side='top', fill='x')

root.mainloop()
BashBedlam likes this post
I welcome all feedback.
The only dumb question, is one that doesn't get asked.
My Github
How to post code using bbtags


Reply


Messages In This Thread
how to change font size - by barryjo - Jan-26-2022, 05:08 PM
RE: how to change font size - by menator01 - Jan-26-2022, 05:19 PM
RE: how to change font size - by barryjo - Jan-26-2022, 07:16 PM
RE: how to change font size - by deanhystad - Jan-26-2022, 07:48 PM
RE: how to change font size - by menator01 - Jan-26-2022, 08:46 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Tkinter menu font size -method to change tonycat 2 7,965 Oct-11-2020, 02:43 AM
Last Post: tonycat
  [Tkinter] Trying to change font size w/o changing button size python63 3 9,996 Aug-05-2020, 01:04 AM
Last Post: Larz60+
  [PyQt] Increase text size and change color based on temp pav1983 5 3,259 Jun-22-2020, 10:52 PM
Last Post: menator01
  TKINTER - Change font color for night or day Ayckinn 2 3,943 May-24-2020, 09:25 PM
Last Post: Ayckinn
  [WxPython] How to change font color of SetHint or SetDescriptiveText? anistorian 5 4,009 Jun-19-2019, 05:30 PM
Last Post: Yoriz
  PyGtk3 why is Locale Folder Size Half of Module Size ? harun2525 1 3,672 Mar-09-2017, 03:46 AM
Last Post: Analyser

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020