We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date
close icon

Auto size rich text

Hi,

I am evaluating syncfusion drawing component.
Please tell me, how can customize text node and rich text node to auto size.
what i want is when user expands text node object it should not only expand the text node object area but also its text like in WORD ART.

any help would be appreciated.

1 Reply

MS Mohamed Suhaib Fahad A. Syncfusion Team September 21, 2007 05:35 PM UTC

Hi,

Thanks for evaluating Syncfusion products.

At present, RichTextNode and TextNode do not support the Auto Font resize with respect to Node resize.

However we do have a way to get this done. By changing the font size in the Model resizing event which will be triggered while resizing the Node will meet this requirement.

[C#]

((DocumentEventSink)diagram1.Model.EventSink).SizeChanging += new SizeChangingEventHandler(Form1_SizeChanging);

void Form1_SizeChanging(SizeChangingEventArgs evtArgs)
{
TextNode node = (TextNode)this.diagram1.Model.Nodes.FindNodeByName(evtArgs.NodeAffected.Name);
node.FontStyle.Size += -(evtArgs.Offset.Height / 2);

}

Please refer the below sample,
http://websamples.syncfusion.com/samples/Diagram.Windows/F68430/main.htm

Please let me know if you want any more details.

Regards,
Fahad

Loader.
Live Chat Icon For mobile
Up arrow icon