Merge pull request #3782 from PySimpleGUI/Dev-latest

Fix so that it updates font correctly
This commit is contained in:
PySimpleGUI 2021-01-10 11:40:13 -05:00 committed by GitHub
commit e179df2257
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 2 deletions

View File

@ -23,14 +23,14 @@ while True: # Event Loop
if event in (sg.WIN_CLOSED, 'Exit'):
break
font_string = 'Helvitica '
font_string += str(values['-slider-'])
font_string += str(int(values['-slider-']))
if values['-bold-']:
font_string += ' bold'
if values['-italics-']:
font_string += ' italic'
if values['-underline-']:
font_string += ' underline'
text_elem.update(font=int(font_string.split(' ')[1].split('.')[0]))
text_elem.update(font=font_string)
window['-fontstring-'].update('"'+font_string+'"')
print(event, values)