Malayalam language in tkinter

Viewed 161

I am trying to create a pdf in Malayalam language using tkinter and reportlab. The operating system in Manjaro. I am able to use malayalam in LibreOffice , text documents etc. But When I run the following code It do not appear properly in TKinter. In pdf I get black coloured squares only. " ഗോപന്‍ ഇവിടെ വരിക ഈ പക്ഷിയെ കാണുക" is the text I am trying to type.

from tkinter import *
from reportlab.pdfgen import canvas
#-*-coding :utf_8 -*-
import unicodedata

akhilGui = Tk()
akhilGui.title("Malayalam")

def func_makepdf():
    
  
    v1= u'ഗോപന്‍ ഇവിടെ വരിക ഈ പക്ഷിയെ കാണുക' #This is the malayalam content which i Want to print as pdf
    v2= v1.encode('utf-8').decode('utf-8')
    c = canvas.Canvas("Malayalam-test.pdf")
    c.drawString(50,800,str(v2))
    resLabel = Label(text= str(v2), fg="#113B53",
           font = "meera", justify='center')
    resLabel.grid(row=2, column=1)

  
    c.save()
    

button_pdf= Button(text="PRINT", fg="#113B53",
           font = "Helvetica 16 bold",command=func_makepdf, justify='center')
button_pdf.grid(row=0,column=0, pady=20, padx=15, sticky= EW)

akhilGui.mainloop()

enter image description here

0 Answers
Related