Page Index Toggle Pages: 1 Send TopicPrint
Normal Topic EnableStyledText with Tables (Read 5980 times)
JGG
YaBB Newbies
*
Offline


I love YaBB 1G - SP1!

Posts: 17
Joined: Feb 27th, 2006
EnableStyledText with Tables
Feb 28th, 2006 at 6:44pm
Print Post  
Hello there,

I'm noticing text within tables tends to get misaligned when styled text is enabled.

You can reproduce this behavior in the FlowChart.NET Demo application.

Go to "Table-related diagrams", "ERM diagram", select an Entity and set "EnableStyledText" to true to any of the boxes. Toggle to see the difference in text alignment.

It gets especially noticeable when text is aligned with the table edges, where it simply falls out of the object.

Is this a bug?

Thanks!
JGG
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: EnableStyledText with Tables
Reply #1 - Feb 28th, 2006 at 7:02pm
Print Post  
Hi,

When EnableStyledText is disabled, the text is aligned internally by the .NET Graphics.DrawString method. When EnableStyledText is set to true, the control uses its own text layout algorithm to arrange the text pieces. It seems the StyledText layout differs slightly from the DrawString implementation, and the difference is bigger when larger fonts are used.

Stoyan
  
Back to top
 
IP Logged
 
JGG
YaBB Newbies
*
Offline


I love YaBB 1G - SP1!

Posts: 17
Joined: Feb 27th, 2006
Re: EnableStyledText with Tables
Reply #2 - Feb 28th, 2006 at 7:13pm
Print Post  
Thanks for your quick answer.

Is this going to be fixed in a future version, or is there any other workaround than creating "phantom" columns to keep the text within the table?

JGG
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: EnableStyledText with Tables
Reply #3 - Feb 28th, 2006 at 7:27pm
Print Post  
I cannot get the text appear outside the table - with what font attributes and text does that happen ? I guess you could use bigger column.Width and row.Height values instead of adding phantom columns or rows.

Stoyan
  
Back to top
 
IP Logged
 
JGG
YaBB Newbies
*
Offline


I love YaBB 1G - SP1!

Posts: 17
Joined: Feb 27th, 2006
Re: EnableStyledText with Tables
Reply #4 - Feb 28th, 2006 at 7:51pm
Print Post  
I think I should have been more precise on what I meant by "falling off" the table.

I have a table with two columns, one with left alignment and the other with right alignment.

To describe what happens more accurately, the text on the right column is offset a bit on the right and gets clipped on the window edge, usually clipping a whole character or more.

Too bad I can't upload a picture, here's some simplified code of what I'm using to generate a table.

Code
Select All
Table table = chart.CreateTable(x, y, 30, 30);
table.CellFrameStyle = CellFrameStyle.None;

table.ColumnCount = 2;
table.RowCount = 3;

table.Columns[0].Width = table.BoundingRect.Width / 2;
table.Columns[1].Width = table.BoundingRect.Width / 2;

table[0,0].Text = "xxxxx";
table[0,1].Text = "yyyyy";
table[0,2].Text = "zzzzz";

table[1,0].Text = "xxxxxxx";
table[1,0].TextFormat.Alignment = StringAlignment.Far;
table[1,1].Text = "yyyyyyy";
table[1,1].TextFormat.Alignment = StringAlignment.Far;
table[1,2].Text = "zzzzzzz";
table[1,2].TextFormat.Alignment = StringAlignment.Far;

table.EnableStyledText = true;
 



See the clipping on the right edge. If you comment the EnableStyledText line, it's set correctly.

One thing I would suspect is the width I'm using on columns to get a 50/50 separation, but even subtracting 1.5 or 2.0 from the right column still clips some of the text.

Hope this helps!
JGG
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: EnableStyledText with Tables
Reply #5 - Feb 28th, 2006 at 8:16pm
Print Post  
Thank you, indeed half of the last character seems clipped when text is right-aligned and using the default font. Our developers will look into that tomorrow.

Stoyan
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: EnableStyledText with Tables
Reply #6 - Mar 1st, 2006 at 2:38pm
Print Post  
That's fixed now. If you wish to try out the updated version, I can send you our daily build of the dll - just let me know which .NET version do you use.

Stoyan
  
Back to top
 
IP Logged
 
JGG
YaBB Newbies
*
Offline


I love YaBB 1G - SP1!

Posts: 17
Joined: Feb 27th, 2006
Re: EnableStyledText with Tables
Reply #7 - Mar 2nd, 2006 at 1:04pm
Print Post  
Thanks, that would be quite appreciated. I'm currently using .NET Framework 1.1 at work.

If you're using e-mail to send it, I'll give you the address by private message.

Thanks!
JGG
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: EnableStyledText with Tables
Reply #8 - Mar 2nd, 2006 at 1:45pm
Print Post  
Hi,

Here is the today's build of the dll:

https://mindfusion.org/_temp/FlowChart.NET.zip

Just overwrite the dlls in the flowchart.net installation folder.

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