6

I'm working in Ubuntu with python 3.x, I'm trying to display some emojis in tkinter. In windows I solved this problem by displaying the equivalent surrogate pair Python: Find equivalent surrogate pair from non-BMP unicode char, but in Ubuntu when I try to do this with some emojis the program crashes giving this error,

CODE:

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()

ERROR:

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

Actually I don't think that's a python problem, maybe it is an OS problem. I haven't found so much searching for a solution.

j_4321
  • 15,431
  • 3
  • 34
  • 61
Mat.C
  • 1,379
  • 2
  • 21
  • 43

0 Answers0