Page Index Toggle Pages: 1 Send TopicPrint
Normal Topic Font is not serializing correctly (Read 2744 times)
Kiran B
Full Member
***
Offline


I Love MindFusion!

Posts: 102
Joined: Apr 19th, 2013
Font is not serializing correctly
Oct 16th, 2013 at 11:49am
Print Post  
Hi,

We are setting the font for shapes as given below in client side while creating the node.

node.setFont(new MindFusion.Drawing.Font("Open Sans", 5, true, false));

But when it reaches the server and converting to xml its getting saved as Microsoft Sans Serif.

Coz of this while reloading the xml back to diagram the font is displaying differently.

Is there any fix for this?

Thanks
Kiran B
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Font is not serializing correctly
Reply #1 - Oct 16th, 2013 at 12:20pm
Print Post  
Hi,

Perhaps there is no Open Sans font available on the server and it falls back to Microsoft Sans Serif when creating the corresponding .NET Font object. Try setting font attributes through styles instead, the font name is saved only as string then and should not change after post-back.

I hope that helps,
Stoyan
  
Back to top
 
IP Logged
 
Kiran B
Full Member
***
Offline


I Love MindFusion!

Posts: 102
Joined: Apr 19th, 2013
Re: Font is not serializing correctly
Reply #2 - Oct 18th, 2013 at 10:39am
Print Post  
Hi Stoyan,

Could you please give me a sample to give the font using style attribute?

Thanks
Kiran B
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Font is not serializing correctly
Reply #3 - Oct 18th, 2013 at 11:14am
Print Post  
Hi,

Code
Select All
var style = new Style();
style.setFontName("Open Sans");
style.setFontSize(5);
node.setStyle(style);
 



or call diagram.setStyle() to use that font for all nodes.

I hope that helps,
Stoyan
  
Back to top
 
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint