Page Index Toggle Pages: 1 Send TopicPrint
Normal Topic Text Wrapping in Shapes (Read 2876 times)
Freizeitsoldat
YaBB Newbies
*
Offline


I love YaBB 1G - SP1!

Posts: 19
Joined: May 10th, 2009
Text Wrapping in Shapes
Mar 10th, 2011 at 8:33pm
Print Post  
Hi Stoyo,

we would like to implement a better wrapping mechanism for different shapes. At the moment, neigther wrapAtCharacter nor noWrap does really fit.

We would like to implement a "new" wrapAtCharacter function. This function should only be taken into account, if the whole word is bigger then the related line.

Do you have any suggestions how to solve our problem?

Thank you in advance,
Alex
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Text Wrapping in Shapes
Reply #1 - Mar 11th, 2011 at 7:28am
Print Post  
Hi Alex,

You could use custom drawing to render the text by calling Graphics2D.drawString. Alternatively, keep the original text in a separate field and insert new-line symbols in the Text value where you'd like it to wrap. TextFormat.NoWrap should be enabled in that case so that the node wrapping function does no insert additional breaks.

I hope that helps,
Stoyan
  
Back to top
 
IP Logged
 
Freizeitsoldat
YaBB Newbies
*
Offline


I love YaBB 1G - SP1!

Posts: 19
Joined: May 10th, 2009
Re: Text Wrapping in Shapes
Reply #2 - Mar 11th, 2011 at 12:42pm
Print Post  
Hi Stoyo,

thank you for your quick response!

Isnīt there a possibility to directly change the wrapping mechanism in the TextLayout class? There are different procedures to render in elipses or rectangles. Is it possible to add a check like "do only wrap at character if the word is longer then the complete line"?

Thanks,
Alex
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Text Wrapping in Shapes
Reply #3 - Mar 14th, 2011 at 7:36am
Print Post  
Hi Alex,

There is no direct way to change it using the public API. It seems our .NET control always wraps long words when they wouldn't fit on a line, I suppose we can port that to Java for the next release.

Stoyan
  
Back to top
 
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint