formattedTextArea font fog

formattedTextArea font fog

Forum member · Mar 1, 2007
forgive the denseness, but having seen diverse references in the documentation, i'm still not clear on what can and can't be done with fonts in a FormattedTextArea, and how. i see from the FormattedTextArea constructors that i have to pass a FontFamily, either directly, or in a FormattedTextAreaStyle. how are the four fonts in a FontFamily referenced? myFontFamily.Bold...etc. ? what has the HtmlTextArea's FontFaces to do with FormattedTextArea? what if i need to use more than one type face in a FormattedTextArea? can i put, say, Times and TimesBold and Helvetica and HelveticaBold in a FontFamily instead of Times and TimesBold, TimesItalic, TimesBoldItalic? can a FormattedTextArea have more than one FontFamily? what else is there to know that i'm missing? thanks,

Re: formattedTextArea font fog

Support · Mar 1, 2007
Hello, You can add the Verdana font to FormattedTextArea using the FontFamily and also add all four font types to the FontFamily without any problem. Similarly you can add any TrueType or Type1 font. You can also set individual words within the FormattedTextArea to a different font by specifying different font families for each font and using that font family name as the font face. Below is a code snippet: TrueTypeFont verdana = new TrueTypeFont( "verdana.ttf" ); TrueTypeFont verdanaBold = new TrueTypeFont( "verdanab.ttf" ); TrueTypeFont verdanaBoldItalic = new TrueTypeFont( "verdanaz.ttf" ); TrueTypeFont verdanaItalic = new TrueTypeFont( "verdanai.ttf" ); TrueTypeFont arial = new TrueTypeFont( "arial.ttf" ); FontFamily family = new FontFamily("Test",verdana,verdanaBold,verdanaItalic,verdanaBoldItalic); FontFamily family1 = new FontFamily("Arial",arial); htmlText = "<font face="Verdana">Hello</font> <font face="Arial">World</font>" FormattedTextArea formattedTextArea = new FormattedTextArea ( htmlText, x + 5, y + 20, 215, 60, family, 9, false ); formattedTextArea.FontFaces.Add(family); formattedTextArea.FontFaces.Add(family1); Thanks, ceTe Software Support Team

Re: formattedTextArea font fog

Forum member · Mar 1, 2007
ok. i'd like to clarify a few things. i'm still wondering how to invoke the verdanaBold, verdanaItalic, etc. from within the 'family' FontFamily. does one use <b> and <i>? what is the use of the "Test" name in 'family'? does "<font face="Verdana">Hello..." refer to the TrueTypeFont verdana created in line 1 of the snippet? i'm just checking on the Verdana/verdana case disagreement. do i have it right that though i must pass a FontFamily to the FormattedTextArea constructor, it may, or may not, be used, and that i can also create arbitrary FontFamily's with one or four fonts and invoke them by name in the <font face="familyName"> tag. ...and what *does* HtmlTextArea's FontFaces have to do with it? many thanks for bearing with me, marc

Re: formattedTextArea font fog

Support · Mar 1, 2007
Hello Marc, You invoke the bold font of the FontFamily using the Bold property of the FontFamily object and similarly for Italics. I am sorry for the confusion. The word Test should be used in "<font face="Test">Hello..." to use the fonts of the FontFamily class. Yes, you can create FontFamily object that may be not be used or passed to the FormattedTextArea constructor without any problem. Adding the font to the FontFaces allows you to use the font inline within the <font> tag. Thanks, ceTe Software Support Team

Re: formattedTextArea font fog

Forum member · Mar 1, 2007
>You invoke the bold font of the FontFamily using the Bold property of the FontFamily object and similarly for Italics. going from the snippet above, what would i put in a <font> tag to use verdanaBold? would that be <font face="family.Bold"... <font face="Test.Bold? thanks again,

Re: formattedTextArea font fog

Support · Mar 2, 2007
Hello Marc, Yes you can get the verdana bold font by using the bold tag. Following is the sample line of code for this. <b> <font face="Test"> CeTe Software </font> </b> The above line will print the font in verdana bold. You can specify the Italic also in the same way using the Italic tag. <i> <font face="Test"> CeTe Software </font> </i> Thanks, ceTe Software Support Team.