Re: Wrapping Text in SVG

Hi, folks-

On 6/6/13 4:45 AM, Tab Atkins Jr. wrote:
> On Thu, Jun 6, 2013 at 5:39 PM, Dr. Olaf Hoffmann <Dr.O.Hoffmann@gmx.de> wrote:
>>> <svg:textArea> has several logistical problems:
>>>
>>> 1) Its name conflicts with the HTML <textarea> element, and it compounds
>>> this by having different functionality than <textarea>; this will make
>>> it confusing for authors, and makes parsing SVG in HTML (a very common
>>> case today, with script libraries like D3.js and Raphael) much harder (I
>>> suspect browser vendors would not implement this, because of the parsing
>>> conflict);
>>
>> Compared to XHTML textarea it has another name ;o)
>> As you know, there are already elements with different
>> meaning and the same name in SVG and (X)HTML.
>> And it is in another namespace, therefore no real problems.
>> And textArea is already in the SVG namespace, therefore
>> a little bit late now to care about such HTML5-specific problems.
>> If authors want to to provide meaningful content, they should
>> not use HTML-tag-soup ;o)
>
> The four name clashes are a major headache for author-friendly
> parsers.  New ones will come into SVG over my dead body.

Yay, 2 birds with one stone! We can have wrapping text with <textArea> 
and finally be rid of Tab! It's a bargain!

Except, in this instance, I agree with him. I don't see the need for an 
additional element in SVG simply to wrap text, which will not render in 
older browsers at all. I think we should have this simple case covered 
by relying on CSS, and have the more advanced cases covered by:

* <textPath> for text along a path
* CSS Shapes, Regions, and Exclusions for wrapping text into and around 
arbitrary shapes
* HTML-in-SVG for multiple blocks of text, lists, tables, blockquotes, 
and other structured text (hopefully with a nicer hook than the ungainly 
<foreignObject>)


I also agree with your suggestion that we have an intuitive and solid 
way to fit text into the available area. Just how we do that I don't 
know, but I would suggest we rely on CSS there too to help us.

Regards-
-Doug

Received on Thursday, 6 June 2013 21:47:18 UTC