Drawing in NLTK with tkinter-canvas and exporting to postscript, some fonts are not shown

Viewed 84

This is related to the issue https://github.com/nltk/nltk/issues/2429 .

I will repeat the details of the issue here to get quicker replies from the community.

I looked at the code of a drawing demo:

nltk/nltk/draw/util.py

Lines 2534 to 2538 in 33ac28c

 cf = CanvasFrame(closeenough=10, width=300, height=300) 
 c = cf.canvas() 
 ct3 = TextWidget(c, "hiya there", draggable=1) 
 ct2 = TextWidget(c, "o  o\n||\n___\n  U", draggable=1, justify="center") 
 co = OvalWidget(c, ct2, outline="red") 

And trying to insert some Chinese characters in line 2537, I get the following picture:

enter image description here

On the left hand side is rendered by the demo, the right hand side is using the button Print to Postscript.

We can see that actually the rendering is successful as the bold song ti text 可以的 is shown. However, the exporting to ps failed. Not only the Characters but also some math symbols are not exported.

But I am not good at tkinter, so my trial to fix this failed.

I hope someone else can help to fix this.

0 Answers
Related