On Feb 20, 2008, at 2:16 PM, P T Withington wrote:

Max (cc-ed) might be a better resource.  I'm not really up on text.

On 2008-02-20, at 11:42 EST, Lou Iorio wrote:

Hi Tucker,

In this JIRA, there are two problems:

Example 21.12 is trying to show how you can use <text> with multiline=false.

That seems backwards to me. If you want multiple lines, I would think you would have to have multiline="true".

From the reference page for <text>:

multiline
If true, the lines of text are wrapped to fit within the text width. (The name multiline is a misnomer. Unwrapped text can be multiple lines if it contains a <br /> or <p> element, or a line break within a <pre> element. This attribute defaults to true if width and height are explicitly specified. If you set multiline=true, you probably want to explicitly a width for the text also; if multiline=true and you do not specify a width, the system will pick an arbitrary width (100 pixels at the moment). When multiline=true, the text is automatially re-wrapped whenever the content is modified by calls to setText, or whenever the width of the text view is modified.

The text states that you can use <br /> tags to force line breaks, but this doesn't work. The reference says the same thing. This did not work in version 3.4 either.
In the example, the text doesn't break.

canvas height="125">
 <simplelayout spacing="5"/>
 <text bgcolor="#ccccff" multiline="false" width="500" height="100">
Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Cras<br/> nibh. Quisque justo. Donec porta, wisi quis vehicula interdum,<br/>
   augue dui pharetra lectus, non adipiscing purus nibh vitae purus.
 </text>
</canvas>

Example 21.18 is trying to show that you can't have an image in text if there is no text. This doesn't work: the image shows up either way. Here's the example:

<canvas height="100">
 <text multiline="true" height="80">
   Some text and
<img src="./images/horse-3.jpg" width="20" height="20" align="left"/>
   some more text
 </text>
</canvas>

No clue on this. Sounds like it was documenting a bug that has gone away perhaps?


Reply via email to