Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Raphael Text Glow

Tags:

raphael

Does anyone have an idea of how to get a glow to show up on text? I thought it would be pretty easy to do so but nothing is rendering on the fiddle.

Fiddle

Thanks

like image 354
j0hnstew Avatar asked Mar 27 '26 06:03

j0hnstew


2 Answers

It looks to me as though Raphael simply does not support text glow. Check out the first lines of the glow function:

if (this.type == "text") {
    return null;
}

It might be worth your while to investigate the use of print with a Cufonized font -- it'll return a path representing the text you give it instead of a tspan, and glow can be applied to paths.

Or you could settle for creating a simple drop shadow.

I've staged both of these alternatives by way of demonstration here.

like image 122
Kevin Nielsen Avatar answered Mar 28 '26 20:03

Kevin Nielsen


You could create a rectangle behind the text and make that glow. I think that should look just fine. Use getBBox() to find out the size of the rectangle you need.

Something like this: http://jsfiddle.net/7ZPtq/51/

Or maybe use some other primitive, e.g. line.

like image 34
Qnan Avatar answered Mar 28 '26 19:03

Qnan



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!