Added Text.fonts_installed_list - returns the fonts installed as reported by tkinter.
This commit is contained in:
parent
c5fae56754
commit
81599f643b
2 changed files with 35 additions and 9 deletions
|
@ -1,17 +1,20 @@
|
|||
#!/usr/bin/env python
|
||||
import sys
|
||||
import PySimpleGUI as sg
|
||||
from tkinter import font
|
||||
import tkinter
|
||||
root = tkinter.Tk()
|
||||
fonts = list(font.families())
|
||||
fonts.sort()
|
||||
root.destroy()
|
||||
|
||||
'''
|
||||
Showing fonts in PSG / tk
|
||||
Demo Font Previewer
|
||||
|
||||
Gets a list of the installed fonts according to tkinter.
|
||||
Requires PySimpleGUI version 4.57.0 and newer (that's when sg.Text.fonts_installed_list was added)
|
||||
|
||||
Uses the Text element's class method to get the fonts reported by tkinter.
|
||||
|
||||
Copyright 2020, 2021, 2022 PySimpleGUI
|
||||
'''
|
||||
|
||||
fonts = sg.Text.fonts_installed_list()
|
||||
|
||||
|
||||
sg.theme('Black')
|
||||
|
||||
layout = [[sg.Text('My Text Element',
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue