Skip to content
← Back to Community
Upload fonts for use with tkinter?
Profile icon
earwarmers

Hello, is there any way that i can upload custom fonts to use with tkinter in repl.it?

Answered by SixBeeps [earned 5 cycles]
View Answer
Voters
Profile icon
earwarmers
Comments
hotnewtop
Profile icon
SixBeeps

Yeah, if you know where the TTF is you should just be able to up load it and use it as normal. Something like this?

import pyglet,tkinter pyglet.font.add_file('file.ttf') root = tkinter.Tk() MyLabel = tkinter.Label(root,text="test",font=('font name',25)) MyLabel.pack() root.mainloop()
Profile icon
earwarmers

@SixBeeps Ah, thanks

Profile icon
ravenironwing

@earwarmers I tried this, but it doesn't work. It just loads some generic font instead.