Page 1 of 1

Label with stroke vs draw text with stroke

Posted: 2016-06-27T05:23:39-07:00
by rotem
Hey,

I'm trying to achieve the same visual output for label as the one I get with draw text.

Here is the command for the label

Code: Select all

convert -background none -font ./assets/impact.ttf -pointsize 72 -fill white -stroke black -strokewidth 8 label:R -trim label.png
Here is the output for label

Image

----------

Here is the command for the draw text

Code: Select all

convert -background none -size 150x150 canvas:none -font ./assets/impact.ttf -pointsize 72 -fill black -stroke black -strokewidth 12 -gravity Center -draw "text 0,0 'R'" -font ./assets/impact.ttf -pointsize 68 -fill white -stroke none -gravity Center -draw "text 0,0 'R'" -trim draw.png
Here is the output for draw text

Image

The main reason that I want it is because I need to create a canvas with custom size for each char and the stroke not always aligned right with the draw text approach.

Thank you

Re: Label with stroke vs draw text with stroke

Posted: 2016-06-27T05:43:33-07:00
by snibgo
With "-draw text" you write twice: first with a black stroke, then with no stroke but a white fill. You can do that with "label:"

Code: Select all

convert -background none -pointsize 72 -stroke Black -strokewidth 12 label:R -stroke None -fill White label:R -layers merge x.png

Re: Label with stroke vs draw text with stroke

Posted: 2016-06-27T06:15:50-07:00
by rotem
Great, thank you