Skip to content

Commit d490ba6

Browse files
committed
Fixed getting correct font at startup. New figlet on main
1 parent 693dc34 commit d490ba6

2 files changed

Lines changed: 14 additions & 2 deletions

File tree

psgfiglet/psgfiglet.py

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
import sys
99
import pyfiglet
1010

11-
version = '6.1.1'
11+
version = '6.1.2'
1212
__version__ = version.split()[0]
1313

1414
"""
@@ -24,6 +24,7 @@
2424
Made resizing of window work better
2525
Added option to prepend "#" onto front of each line with
2626
Navigating with arrow keys while in font list will select fonts so that previewing can be done quickly
27+
6.1.2 25-Jun-2026 Fixed setting an intial font
2728
"""
2829

2930

@@ -174,6 +175,13 @@ def make_window():
174175
window['-FONT-LIST-'].bind('<Up>', '+UP')
175176
return window
176177

178+
# ███╗ ███╗ █████╗ ██╗███╗ ██╗
179+
# ████╗ ████║██╔══██╗██║████╗ ██║
180+
# ██╔████╔██║███████║██║██╔██╗ ██║
181+
# ██║╚██╔╝██║██╔══██║██║██║╚██╗██║
182+
# ██║ ╚═╝ ██║██║ ██║██║██║ ╚████║
183+
# ╚═╝ ╚═╝╚═╝ ╚═╝╚═╝╚═╝ ╚═══╝
184+
177185

178186
def main():
179187

@@ -228,6 +236,10 @@ def main():
228236
selected_font = values['-FONT-NAME-']
229237
if text.strip() == '':
230238
text = selected_font.strip()
239+
if not selected_font:
240+
selected_font = favorite_fonts[0]
241+
window['-FONT-NAME-'].update(selected_font)
242+
values['-FONT-name-'] = selected_font
231243
# fancy way of detecting the size of the multiline so the window can be resized
232244
# line_length = window["-OUTPUT-"].get_size()[0] // sg.Text.char_width_in_pixels(MULTILINE_FONT)
233245
line_length = window["-OUTPUT-"].get_size()[0] // sg.tkinter.font.Font(font=MULTILINE_FONT).measure('A')

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ def readme():
1111

1212
setuptools.setup(
1313
name="psgfiglet",
14-
version="6.1.1",
14+
version="6.1.2",
1515
author="PySimpleGUI",
1616
install_requires=["PySimpleGUI","pyfiglet"],
1717
description="Create Figlets using a PySimpleGUI GUI and pyfiglet. A PySimpleGUI Demo Program.",

0 commit comments

Comments
 (0)