gm icon indicating copy to clipboard operation
gm copied to clipboard

Unrecognized option (-text-font)

Open kanbekotori opened this issue 9 years ago • 4 comments

gm(200, 100, '#fff')
  .drawText(10, 40, 'kotori')
  .pointSize(26)
  .textFont('Candice')
  .write('/Users/jiangxingshang/Downloads/2.jpg', function(err) {
  if(err) console.log(err);
});
{ [Error: Command failed: gm convert: Unrecognized option (-text-font).
] code: 1, signal: null }

I have installed ghostscripts, what is this error mean? Is something i miss? Without the "drawText" function it works.

kanbekotori avatar Aug 10 '15 05:08 kanbekotori

Try with .text('Candice')

drochag avatar Aug 25 '15 02:08 drochag

Initial code that failed with unrecognized option (-text-font)

gm('out.svg')
  .textFont('Roboto')
  .write('out.png', function(err) {
    if (err) {
      return console.log(err);
    }
      console.log('image converted.');
  });
});

Refering to the comment above, i had tried replacing .textFont('Roboto') to .text('Roboto'). And, This is error i get now

TypeError: gm(...).text is not a function

jaladankisuresh avatar Mar 09 '17 09:03 jaladankisuresh

Same problem. Any ideas?

Edit: While the Graphicsmagick site still lists -text-font as an option, doing gm help convert shows that on my system (Arch Linux, GraphicsMagick 1.3.26 2017-07-04 Q16) there is no longer a -text-font option, but there is now a -font option (there is also no -text option).

rhclayto avatar Aug 29 '17 07:08 rhclayto

Did just run into the same issue. You can use .font('Roboto')

janober avatar Nov 18 '20 12:11 janober