在Tkinter中显示表情符号

时间:2019-04-22 09:32:14

标签: python ubuntu tkinter

我正在研究ubunutu wpith python 3.x,我正在尝试在tkinter中显示一些表情符号,在Windows上,我通过显示等价替代对Python: Find equivalent surrogate pair from non-BMP unicode char找到了解决方案,从而解决了该问题。 ubuntu,当我尝试使用一些表情符号执行此操作时,程序崩溃,给出此错误,

代码:

import tkinter as tk

root = tk.Tk()
canvas = tk.Canvas(root)
canvas.pack()
x, y= 0, 0
for _ in range(100):
    canvas.create_text(x, y, text='\ud83d\ude4f', anchor=tk.NW)
    y += 10


root.mainloop()

错误:

X Error of failed request:  BadLength (poly request too large or internal Xlib length error)
  Major opcode of failed request:  139 (RENDER)
  Minor opcode of failed request:  20 (RenderAddGlyphs)
  Serial number of failed request:  199
  Current serial number in output stream:  199

实际上我不认为这是python问题,也许是操作系统问题 我没有找到太多寻找解决方案的东西。

0 个答案:

没有答案