How do you display a TM or Copywrite symbol within the text of a FormattedTextArea?
Trademark and other symbols in FormattedTextArea
Re: Trademark and other symbols in FormattedTextArea
Forum member · Mar 22, 2011I did find the following thread:
http://www.DynamicPDF.com/Forums/DisplayThread.csp?ForumID=1&ThreadID=191#619
which told me that the Helvetic font family that I am using probably doesn't have the encoding for the character I am trying, and that I should use the Symbol font family. This brings up the question: How do you display text along with symbols within the same FormattedTextArea?
Thanks.
Re: Trademark and other symbols in FormattedTextArea
Support · Mar 23, 2011Hello,
You can use more than one font to add text in different styles using our DynamicPDF product. You will have to use the font faces to do this. You will need to create OpenTypeFont object using the desired font and use this object to build a FontFamily. you can add this FontFamily to font faces of the FormattedTextArea using FontFaces class. Below is the sample code for it. Similarly you can have any number of font families and use them according to your requirement.
OpenTypeFont symblolFont = new OpenTypeFont(@"ARIALUNI.TTF");
FontFamily fontfamilysymblol = new FontFamily("symblolFont", symblolFont);
OpenTypeFont verdanaFont = new OpenTypeFont(@"Verdana.ttf");
FontFamily fontFamilyVerdana = new FontFamily("verdanaFont", verdanaFont);
string str = "<HTML><Body><p><font face= \"verdanaFont\">DynamicPDF</font><font face=\"symblolFont\">\u2122</font></p></Body></HTML>";
FormattedTextArea formattedTextArea = new FormattedTextArea(str, 100, 200, 400, 400, FontFamily.Helvetica, 12, true);
formattedTextArea.FontFaces.Add(fontfamilysymblol);
formattedTextArea.FontFaces.Add(fontFamilyVerdana);
Document doc = new Document();
Page page = new Page();
page.Elements.Add(formattedTextArea);
doc.Pages.Add(page);
doc.Draw(@"C:\Temp\Test.pdf");
Thanks,
ceTe software Support Team.