textnode height

I have already known the string content and I want to display the string in the textnode,How to go the textnode height when the textnode width is known and I also want to set up textnode linesapce? Thank you.


5 Replies

AA Amsath Ali M Syncfusion Team December 21, 2011 12:18 PM UTC

Hi Songjian,

Thanks for your interest in Syncfusion products.

Since we are unable to get your actual intention form your query, could you please share us more information probably a screenshot which clearly describe your intentions, which will be more helpful for us to provide a better solution to you?

Please let us know if you have any queries.

Regards,
Amsath Ali. M




SO songjian December 23, 2011 02:49 PM UTC

My question is that if I have knows the content of the textnode.text and the textnode width and I also want to set the textnode line space ,how to compute the textnode height.Thank you.



PM Pandi Murugan A Syncfusion Team December 26, 2011 07:44 AM UTC

Hi Songjian,

Thanks for the update. We regret for the inconvenience caused.

You can use the below code for your requirement.

[C#]
TextNode txtNode = new TextNode("This is an example");
float width = 25;
SizeF size = SizeF.Empty;
if (size == SizeF.Empty && txtNode.Text != string.Empty)
{
using (Graphics gfx = Graphics.FromHwnd(IntPtr.Zero))
{
Font fntTemp = txtNode.FontStyle.CreateFont();
size = gfx.MeasureString(txtNode.Text, fntTemp, (int)width, txtNode.GetStringFormat());
}
}
//textNode height
float height = size.Height;

Please let me know if you have any concerns.

Regards,
Pandi Murugan A




SO songjian December 29, 2011 01:07 AM UTC

Thank you. The textnode doesn't have the linespace property, but I want to set the linespace when the textnode has multiline. How to solve it? Thank you.



AA Amsath Ali M Syncfusion Team January 2, 2012 01:25 PM UTC

Hi Songjian,

Thanks for the update.

Currently, we don’t have support to “Linespace property for TextNode” and your request has been suspected to be a feature. For this, please create a DT incident for your query so that we can update the patch for this feature.

You can create the DT incident from the following link.
<http://www.syncfusion.com/account/dashboard>

In the interests of maintaining confidentiality, we have a policy of not sharing patches or otherwise proprietary customer specific information in the public Forum.

Please let us know if you have any queries.

Regards,
Amsath Ali. M





Loader.
Up arrow icon