I
I
ivanesi2015-10-02 08:07:53
JavaScript
ivanesi, 2015-10-02 08:07:53

How to correctly draw non-Latin characters in graphicsMagic?

var text = "\u4F60 哦 test тест";
gm('img.jpg')
  .font('arial.ttf')
  .encoding('Unicode')
  .fill('#00000000')
  .fontSize('100px')
  .drawText(0, 0, text, 'Center')
 .write('img2.jpg', function (err){ console.log(err) });

Everything seems to be correct, but only Latin characters are displayed correctly. I've tried a lot of fonts.

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question