更改 tkinter canvas 文本的纵横比 object

Change Aspect ratio of tkinter canvas text object

我已经在 tkinter 上放置了一些文本 canvas。

我将如何更改此文本的纵横比。

在我的例子中,我在使用 canvas.create_text 创建的 canvas 上有一个字母。 我想改变这封信的高度,同时保持它的宽度。 从视觉上看,这封信看起来像是在向前倒下或围绕 horizon 旋转。 我还想在不改变高度的情况下改变字母的宽度。 这种情况在视觉上看起来像是在旋转。

canvas.scale 更改绘制字母的坐标系,但不更改字母本身的比例。

这是一个简短的例子。我希望字母的高度跟随两边线条的高度。但是字母的宽度应该保持不变。

import tkinter as tk
from tkinter import font


class FlipDigit():
    def __init__(self,master):
        self.master = master
        self.digit = tk.Canvas(master,width= 150,height = 150,bg='black')
        self.font = font.Font(family ='Calibri',size = 150)
        self.letter = self.digit.create_text(75,75,text = 'A',fill = 'white', font = self.font)
        self.digit.create_line(5,25,5,125,width=10,fill = '#808080')
        self.digit.create_line(145,25,145,125,width = 10,fill = '#808080')
        self.digit.pack()        
        self.count = 0
        self.master.after(50,self.Bump)
    def Bump(self):
        yscale = .8
        if self.count > 10:
            yscale = 1.25
        if self.count >20:
            self.count = -1
        self.count += 1
        self.digit.scale('all',75,75,1,yscale)
        self.master.after(150,self.Bump)

if __name__ == '__main__':
    root = tk.Tk()
    Digit = FlipDigit(root)
    root.mainloop()

我认为在 tkinter 中没有任何方法可以做到这一点。您不能独立于宽度更改字体的高度。