W3C home > Mailing lists > Public > www-style@w3.org > March 2011

Re: Possible text-shadow enhancements

From: Simon Fraser <smfr@me.com>
Date: Tue, 01 Mar 2011 22:45:41 -0800
Cc: Brian Manthos <brianman@microsoft.com>, Jordan OSETE <jordan.osete@gmail.com>, "www-style@w3.org" <www-style@w3.org>
Message-id: <150934D3-85AE-4BB2-840F-706CD6D11F08@me.com>
To: Brad Kemper <brad.kemper@gmail.com>
On Mar 1, 2011, at 10:00 pm, Brad Kemper wrote:

> Oops. Sent it before I was ready.
> 
> On Mar 1, 2011, at 8:26 PM, Simon Fraser wrote:
> 
>> On Mar 1, 2011, at 7:55 PM, Brad Kemper wrote:
>> 
>>> On Mar 1, 2011, at 5:36 PM, Simon Fraser wrote:
>>> 
>>>>> http://dev.w3.org/csswg/css3-text/
>>>>> http://www.w3.org/TR/css3-text/#text-shadow
>>>>> 
>>>>> These two drafts agree: "<shadow> is the same as defined for the ‘box-shadow’ property except that the ‘inset’ keyword is not allowed."
>>>>> 
>>>>> Simon, are you suggesting that the current text-shadow spec should be reconsidered *or* that text-outline should stay alive because of the distinction? (Or both?)
>>>> 
>>>> I think spread is problematic (if convenient) in the context of box-shadow, and, although I see the benefit of keeping text-shadow and box-shadow similar, I question the utility of spread for text-shadow.
>>> 
>>> I would say that spread is considerably more important on text than on rects. Text is full of thin strokes of 1 or 2 pixels (until you get to larger font sizes). If you do a couple or more pixels of blur, you lose the shape. With spread, you can beef it up a little bit so that the letter is still letter shaped after the blur. You don't have to completely lose the shape in order to get the shadow to stick out far enough to be noticable.
>>> 
>>>> I also have no idea how to implement spread on non-rounded-rect shapes, and whether it's possible in a way that has the same behavior as box-shadow's spread in terms of corner rounding.
>>> 
>>> The way it is defined for box-shadow is pretty box-specific, in terms of defining "cheats" that work for those shapes. For other shapes, you would either have to do a true vector stroke (see how Adobe Illustrator does path stroking, for instance, with limits on how pointy a corner can get), or live with the rounding. I feel rounding of the corners of the text shadow is not that bad, if that is what is required to get spread. It is not that noticeable if the effect is being used to simulate a drop shadow. If you are using it to get a thick outline, then that doesn't work as well.
>> 
>> Do you want authors to have control of the corner treatment (rounded vs. mitre etc)?
> 
> 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 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.

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

Simon
Received on Wednesday, 2 March 2011 06:46:28 GMT

This archive was generated by hypermail 2.3.1 : Tuesday, 26 March 2013 17:20:38 GMT