This may be a dumb question, but I can't figure out how to make text bold or italic. I have scoured the documentation (as well as the forums) and I don't find an answer.
Is it only possible for true type font? (I notice there is IsTrueTypeFontBold and IsTrueTypeFontItalic properties.)
I should add that I am using Arial as the font type, primarily.
Cynthia
Hi,
Thank you for considering Aspose.
Yes it is supported with True Type Fonts. I have used this chunk of code and it works to change the text to Bold and Italic.
//TrueType font example
Text text2 = new Text(sec1);
text2.Margin.Top = 30;
sec1.Paragraphs.Add(text2);
Segment segment2 = text2.Segments.Add("This is TrueType font 'Arial Bold Italic'.");
segment2.TextInfo.FontSize = 20;
segment2.TextInfo.FontName = "Arial";
segment2.TextInfo.IsTrueTypeFontBold = true;
segment2.TextInfo.IsTrueTypeFontItalic = true;
Thanks.
Adeel Ahmad
Support Developer
Aspose Changsha Team
https://forum.aspose.com/Wiki/default.aspx/Aspose.Corporate/ContactChangsha.html