The Syncfusion native Blazor components library offers 70+ UI and Data Viz web controls that are responsive and lightweight for building modern web apps.
.NET PDF framework is a high-performance and comprehensive library used to create, read, merge, split, secure, edit, view, and review PDF files in C#/VB.NET.
Hello,
Still on the subject of symbol labels, sorry.
I add a label to a Symbol, then I manipulate the label text properties, e.g. font size, style etc.
Unless I force a "SizeToText" on the Symbol, the symbol will not be resized according to the new text properties, and the text may be truncated.
Is this the intended behaviour?
See code below:
SymbolLabel symbolLabel = this.AddLabel(text,BoxPosition.MiddleRight) as SymbolLabel; //this is subclassed from Symbol
if(null != symbolLabel)
{
//Set some defaults
symbolLabel.OffsetX = 10;
symbolLabel.OffsetY = 0;
symbolLabel.FontStyle.Family = "Verdana";
symbolLabel.FontStyle.PointSize = 8.25F;
symbolLabel.VerticalAlignment = StringAlignment.Center;
symbolLabel.HorizontalAlignment = StringAlignment.Center;
symbolLabel.DirectionRightToLeft = false;
symbolLabel.NoClip = true;
symbolLabel.WrapText = false;
//What we DO have to do is manually force a resize of the symbol label, because some
//text properties have changed.
symbolLabel.SizeToText();
}
regards
Richard
PS.
Forgot to mention,
The symbol size is automatically recalculated if the SymbolLabel.Text is modified again after playing with the font etc.
And this is all with V3.3.0.0
regards
Richard
ADAdministrator Syncfusion Team September 12, 2005 03:53 PM UTC
Richard,
Calling SymbolLabel.SizeToText() should do the trick. Are you having trouble with this?
Thanks,
Prakash Surendra
Syncfusion Inc.,
RDRichard DeversonSeptember 13, 2005 08:56 AM UTC
Hi Prakash,
Yes, SizeToText works fine, and I can live with it as is.
My question was just whether the SizeToText should be done within the label class itself, e.g. whenever a font property is changed.
regards
Richard
ADAdministrator Syncfusion Team September 15, 2005 01:51 PM UTC
Richard,
You are right about this. I will go ahead and log a QA report, and we will try to address the problem in a future update of the product.
As always, thank you for bringing the issue to our attention.
Regards,
Prakash Surendra
Syncfusion Inc.