1. Anuncie Aqui ! Entre em contato fdantas@4each.com.br

[Python] How do I get a font to stay the same when someone runs my tkinter exe on their...

Discussão em 'Python' iniciado por Stack, Outubro 7, 2024.

  1. Stack

    Stack Membro Participativo

    I'm trying to create a GUI standalone application using tkinter. Where is a font dependency issue while running the script. Getting AttributeError: 'NoneType' object has no attribute 'add_file'. Below is the code and error screenshot.

    import pyglet,tkinter

    if name == "main":

    pyglet.font.add_file('fonts/Cera-Round-Bold.ttf')

    root = tkinter.Tk()
    MyLabel = tkinter.Label(root,text="test",font=('Cera Round Variable DEMO',25))
    MyLabel.pack()
    root.mainloop()


    Error screenshot Font Style/Name

    Tried using pyglet module. No luck.

    Continue reading...

Compartilhe esta Página