W3C home > Mailing lists > Public > www-svg@w3.org > September 2006

Re: Question about inserting text in to rectangle

From: Chris Lilley <chris@w3.org>
Date: Wed, 20 Sep 2006 15:17:28 +0200
Message-ID: <239424408.20060920151728@w3.org>
To: "Meir Galperin" <meir@cell-guide.com>
Cc: www-svg@w3.org

On Tuesday, September 19, 2006, 9:28:45 AM, Meir wrote:

MG> Hello.

MG> I would like to ask question about writing text into rectangle.
MG> Is it possible that full inserted text will be insert in to rectangle automatically?
MG> It means that full inserted text automatically will be divided in
MG> to lines and inserted in to rectangle.

In SVG 1.1 not, that is not possible. Its a commonly requested feature, but in SVG 1.1 you have to insert the line breaks manually and provide a font to be sure that text fits inside a given rectangle.

In SVG Tiny 1.2, this is possible.
http://www.w3.org/TR/SVGMobile12/text.html#TextInAnArea

MG> What have I change in the example for inserting all text into rectangle?


MG> <g transform="translate(400 300 ) "> 
MG>                 <rect x="0" y="0" width="200" height="100"
MG> fill="lightblue" stroke="blue" stroke-width="1"/> 
MG>                 <text x="100" y="50" text-anchor="middle"
MG> pointer-events="none">One two three One two three One two three One
MG> two three One two three One two three One two three One two three
MG> One two three One two three One two three One two three One two
MG> three One two three One two three One two three One two three One two three </text>
MG>  </g>

<g transform="translate(400 300 )"> 
    <rect x="0" y="0" width="200" height="100" 
		 fill="rgb(173, 216, 230)" stroke="blue" stroke-width="1"/> 
    <textArea x="10" y="10" width="180" height="80"
          text-align="center" pointer-events="none">One two three One two three One two three One two three One two three One two three One two three One two three One two three One two three One two three One two three One two three One two three One two three One two three One two three One two three </textArea>
</g>


-- 
 Chris Lilley                    mailto:chris@w3.org
 Interaction Domain Leader
 Co-Chair, W3C SVG Working Group
 W3C Graphics Activity Lead
 Co-Chair, W3C Hypertext CG
Received on Wednesday, 20 September 2006 13:17:41 GMT

This archive was generated by hypermail 2.3.1 : Friday, 8 March 2013 15:54:35 GMT