text-to-svg icon indicating copy to clipboard operation
text-to-svg copied to clipboard

Outline text?

Open TimotheAlbouy opened this issue 6 years ago • 3 comments

Is it possible to outline the text created with this module? For example, I would like to write text in white and outlined in black. This feature is possible with the vectorize-text module.

TimotheAlbouy avatar Feb 06 '19 10:02 TimotheAlbouy

Will the image look like this?

image

If so, you can use attributes options like this.

textToSVG.getSVG('hello', {attributes: {fill: "white", stroke: "black"}});

shrhdk avatar Jul 09 '19 15:07 shrhdk

Yes that's good, thank you very much! But the strokes are outside the edges of the letters or are they a bit inside?

TimotheAlbouy avatar Jul 11 '19 20:07 TimotheAlbouy

@TimotheAlbouy

They are a bit inside.

If you want the stroke to be outside the edge, try the paint-order property.

https://www.oreilly.com/ideas/elegant-outlines-with-svg-paint-order

shrhdk avatar Jul 12 '19 13:07 shrhdk