I have a site for customize football jersey design. I’m using Raphael.js customization and I need to know how we can apply outline for a text in Raphael.
On searching, I got the suggestion of using the stroke property of Raphael. But this is not giving an outline effect. Stroke is actually Inline. When we increase stroke width, the width of the text will decrease.
How do I apply outline for a text in Raphael without reducing width of text?
Text before stroke :
Text after stroke:
Text needs to be like this on applying stroke/outline (just demo from photoshop):
3
Answers
Try this.
“The paint-order attribute specifies the order that the fill, stroke, and markers of a given shape or text element are painted.”
https://developer.mozilla.org/en-US/docs/Web/SVG/Attribute/paint-order
What you want would be
Dan, expanding on the example you gave
Beware for IE does not support
I just had this problem. An easy solution is to add the text twice at the same position. First add text in the color you want the stroke to be, and add your stroke. Then, add the text again with the desired fill color and no stroke. Adjust the stroke width on the first text element until you achieve the desired effect.