Re: Possible text-shadow enhancements

On Mar 1, 2011, at 10:45 PM, Simon Fraser <smfr@me.com> wrote:

>> For shadows, I don't feel strongly about that. It is more important for creating sharp-edged outlines. 
>> 
>>> It feels to me that this is more like a text stroke than a shadow spread.
>> 
>> If you stroke the text with a path with rounded corners before blurring, it is mostly un-discernible from doing a raster spread, AFAIC.
> 
> People use shadows with zero blur radius all the time. In that case, it matters.

I'm not sure what you think I am disagreeing with. If you are saying that it matters for people to be able to control corner joins of strokes if they are going to be doing spreading, then fine. All I'm saying is that I could live without that level of control easier than I could live without text-shadow spread at all. 

If you don't have sharp corners, then id guess a simple raster effect is probably cheaper and easier than an Adobe Illustrator-like stroking of a vector path (from the font outline data).

>>> I think it would have to be implemented by the UA in terms of stroking the glyphs before casting the shadow, so the corner behavior is important.
>> 
>> Or, said differently, if corner behavior is important (and in some cases, I suppose it would be, but I'm not sure they are the main use case), then it would have to be implemented by the UA in terms of stroking the glyph shadows before blurring.
> 
> I don't understand what "stroking the glyph shadows" means.

Use the outline data of the font to create a shadow-colored stroke around a shadow-colored fill at the offsets of where you want to draw the shadow. You wouldn't be stroking the glyphs that were part of the normal text that appears in front of the shadows. Only the shadows themselves need to be spread with a stroke. 

> To generate the mask for blurring, you'd render the glyph, then render a stroke of some thickness based on the spread.

I dont think you'd use rendered pixels to generate the spread if you wanted sharp corners. You'd use the outlines in the vector-based font, so that you knew where the corners were and how sharp their angles were, and so on.  

Or if that's too expensive, settle for rounded corners when you spread. 

Received on Wednesday, 2 March 2011 08:47:46 UTC