We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date

.Net Font to Syncfusion FontStyle

Hi, I was trying to convert from a .Net Font to a Syncfusion FontStyle. (The label fontstyle property from symbols) private static void NetFontToSyncfusionFont(//this function should exist in Syncfusion System.Drawing.Font f1, Syncfusion.Windows.Forms.Diagram.FontStyle f2){ f2.Family=f1.Family; f2.PointSize=f1.SizeInPoints; f2.Strikeout=f1.Strikeout; f2.Style=f1.Style; } What''s the correct way of doing this ?

1 Reply

AD Administrator Syncfusion Team February 15, 2005 05:24 PM UTC

Hi Jose, The following is the method used by the Diagram.FontStyle class to create it''s System.Drawing.Font object, // FontStyle.CreateFont function public Font CreateFont() { return new Font(this.Family, this.Size, this.Style, this.Unit); } FontStyle.Family is a string value representing the FontFamily.Name property, the FontStyle.Size equates to the font size, the FontStyle.Style value is the System.Drawing.FontStyle eqivalent for the font and the FontStyle.Unit is the GraphicsUnit unit of measure to be used by the new font. You should initialize your Diagram.FontStyle object with values for the listed properties that will correctly reflect the System.Drawing.Font that you want. Prakash Syncfusion, Inc.,

Live Chat Icon For mobile
Up arrow icon