我正在嘗試使用Image模塊來製作其中包含希伯來字體的位圖。當從shell打印(空閒)時,我設法打印希伯來文,但是當試圖將文本繪製到位圖時,它會繪製一些ascii文字。使用圖像模塊(python)將希伯來語文本繪製爲圖像
這是代碼:
import Image
import ImageDraw
a = "אריאל" #or any other hebrew string
im=Image.new('RGB',(200,200),(100,100,100)) #type file,size,Background color
d=ImageDraw.Draw(im)
d.text((0,0),a) #should draw the string
im.show()
任何幫助將是非常讚賞。