Search code examples
pythonfontspysimplegui

How to make the label text bold in PySimpleGUI?


for example

label = sg.Text("Hello World", font="Helvetica")

How to make this text Bold ?

Also, is there any source that all of the supporting fonts by PySimpleGUI are mentioned?


Solution

  • The font parameter can be used to specify a bold font

    for example:

    import PySimpleGUI as sg
    
    label = sg.Text("Hello World", font=("Helvetica", 12, "bold"))
    
    layout = [[label]]
    
    window = sg.Window("My Window", layout)
    event, values = window.read()
    window.close()
    

    For the supported fonts, you can go to https://www.cssfontstack.com/ to see a list of the most used