title: writing text on image with npm node-canvas in custom language
body: <p>I am trying to write on image with hindi language. I am using node-canvas  library. There is some problem with my output. Can someone help me ?</p>
  
  <pre><code>const { createCanvas, loadImage, registerFont} = require('canvas')
  const canvas = createCanvas(400, 400)
  const ctx = canvas.getContext('2d')
  
  var str= "यह.  मिसिसिपी   है";
  console.log(str);
  loadImage('missisippi.jpg').then((image) =&gt; {
    console.log(image);
    ctx.drawImage(image, 0 , 0, 400, 400);
    ctx.fillText(str,100,40);
    var body = canvas.toDataURL(),
    base64Data = body.replace(/^data:image\/png;base64,/,""),
    binaryData = new Buffer(base64Data, 'base64').toString('binary');
  
      require("fs").writeFile("out.png", binaryData, "binary", function(err) {
        console.log(err); // writes out file without error, but it's not a valid image
      })
  
      // console.log('&lt;img src="' + canvas.toDataURL() + '" /&gt;')
  })
  </code></pre>
  
  <p>This is the output image . <a href="https://i.stack.imgur.com/kmkxt.png" rel="nofollow noreferrer"> You can see that  मिसिसिपी is grammatically wrong. </a> (In case u are familiar with Hindi.</p>
  
  <p>I have also tried the very same thing with npm-gm. in that too I faced same issue. Can someone help me out in this issue ? </p>
  
  <p>How can I write text on image with custom font ? </p>