How to split text in nevron shape?


https://www.nevron.com/Forum/Topic8616.aspx
Print Topic | Close Window

By surendra koritala - 10 Years Ago
Hi,
Here's my doubt:
How can i split text in nevron shape and assign different fontstyles for different lines of text.
For examples: lets us consider below two lines as my shape.Text:       
USA
Land Of Opportunities

I want to make USA as bolded in shape text and rest of the text as normal. Please find below code i am using for customizing text format in nevron shape:

Font ftName = new Font("Arial", 10, FontStyle.Bold);
Font ftInputs = new Font("Arial", 10);

shape.Style.FillStyle = new NSizeF(width, (height/2));
shape.CollapsedSize = new NColorFillStyle(backgroundColor);

shape.Name = name;
shape.Text = shapeText;

shape.Tag = tag;

NTextStyle textStyle = new NTextStyle(ftInputs, IOsColor); //Create a NTextStyle object

textStyle.StringFormatStyle.HorzAlign = Nevron.HorzAlign.Left; //Horizontal alignment
textStyle.StringFormatStyle.VertAlign = Nevron.VertAlign.Top; //Vertical alignment
textStyle.Offset =new NPointL(2, 2); //The offset within the object

NStyle.SetTextStyle(shape, textStyle); //Set the objects text style

In the above code, textStyle is customizing entire text to font: arial , 10.

I want shape name to be bolded. my text contains shape name and additional text. how to make shape name bolded.

Regards,
Suren

 

           

 

           

 

 

By Nevron Support - 10 Years Ago
Hi,

You can use XML formatted texts. Take a look at XML Formatted Texts documentation topic for more information.