gm
gm copied to clipboard
Unrecognized option (-text-font)
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.
Try with .text('Candice')
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
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).
Did just run into the same issue. You can use .font('Roboto')