Vertical text in Tkinter Canvas

后端 未结 3 1453
梦毁少年i
梦毁少年i 2020-12-21 01:43

Is there a way to draw vertical text in Tkinter library? (Python recommended)

textID = w1.create_text(5, 5, anchor=\"nw\")
w1.itemconfig(textID, text = \"Thi         


        
3条回答
  •  孤城傲影
    2020-12-21 02:02

    I don't know any way to make vertical text in tkinter, but you can just make an image of the vertical text you want

    1. Screen shot the text you want and crop it
    2. Screen shot the background colour and crop it
    3. In word or powerpoint or something, put the text over the background
    4. Take another screenshot and crop that
    5. Put that screen shot in paint
    6. Save the paint file in the same folder as your program
    7. convert the paint file to a gif online: http://image.online-convert.com/convert-to-gif
    8. Use the following code to put the image in your program

    vertical_text = PhotoImage(file = ".gif") canvas.create_image(x, y, image = vertical_text)

    Here is a screenshot from a tkinter window in a program I'm making which lets you revise words example

提交回复
热议问题