ASE Home Page Products Download Purchase Support About ASE
ChartDirector Support
Forum HomeForum Home   SearchSearch

Message ListMessage List     Post MessagePost Message

  Text in Text box wrappin too early
Posted by Ankit Jain on Nov-09-2017 16:01
Attachments:
Hi Peter,

I am adding some text in text box but before breaching of width it wraps the text.

Please refer to attached image

The string i am putting in is "Step1                                                 Step 2"

alignment of box is center.

I have also put tb.setBackground(Chart.Transparent,0x00FF00); for text box to show the actual width of box.
Ideally there is space for string "2" but it wraps and put in next line.

Thanks
Ankit
textbox.jpg

  Re: Text in Text box wrappin too early
Posted by Peter Kwan on Nov-10-2017 05:46
Hi Ankit,

Is the output created in SVG?

For SVG, the actual rendering is done on the SVG viewer. (For example, for web application, it is the browser.) There is the issue that different browsers and different brand or version of operating systems render the same SVG text differently. ChartDirector computes a length for the text and use it to layout the text and draw the rectangle. When the output is sent to the browser, the browser may render the text at a different length. The issue is most visible for long text in which many characters are the same. (For your case, there are many space characters.)

If you must use SVG, for your particular case, you may consider to use the "
<*advanceTo=22*>" tag in your text, like:

"Step 1<*advanceTo=100*>Step 2"

The <*advanceTo=100*> tag moves the cursor to the 100th pixel of the text line, and the Step 2 is positioned there. There is also an <*advance=xxx*> tag that moves the cursor forward by xxx number of pixels.

The following is an example that uses <*advanceTo=xxx*> (for the legend box text).

http://www.advsofteng.com/doc/cdnet.htm#legendpie2.htm

The following is the reference for the available tags:

http://www.advsofteng.com/doc/cdnet.htm#cdml.htm

Regards
Peter Kwan

  Re: Text in Text box wrappin too early
Posted by Ankit Jain on Nov-11-2017 23:10
Hi Peter,

Thanks for your suggestion and inputs.
yes these are SVG images and i tried changing type of image i got the result i want.

However for SVG i think at this point of time i can't do much as this is how image is getting rendered.

Appreciate your prompt and accurate replies.

Thanks
Ankit