RadEditor for ASP.NET

Fonts Send comments on this topic.
See Also
DropDowns > Fonts

Glossary Item Box



Telerik RadEditor is powerful enough to be used in any language you like, e.g. English, Bulgarian, Russian, Hindi, Vietnamese, Chinese, Japanese, Korean, etc.

You'll need to set the proper encoding in the aspx files with the editor. You can use the following encoding:
<?xml version="1.0" encoding="utf-8" ?>, which will make the editor compatible with Western Europe languages, Cyrillic, Greek, Asian, Arab, Chinese, Japanese, etc characters.

 

If the characters are displayed properly by the browser on the same page where the editor is, they should be displayed properly in the editor as well.

 

The WYSIWYG Fonts dropdown of Telerik RadEditor displays a predefined set of fonts which by default are: Arial, Comic Sans MS, Courier New, Tahoma, Times New Roman, Verdana. All fonts are set using the FontNames Collection. You can easily modify this set or add a new font (as long as it is available on the client machine), using the Add method for the collection:

ASPX/ASCX Copy Code
<rad:radEditor id= "RadEditor1" runat= "server"></rad:radEditor>

C# Copy Code
RadEditor1.FontNames.Add("Arial");
RadEditor1.FontNames.Add(
"Arial Narrow");
RadEditor1.FontNames.Add(
"Arial Black");
VB.NET Copy Code
RadEditor1.FontNames.Add("Arial")
RadEditor1.FontNames.Add("Arial Narrow")
RadEditor1.FontNames.Add("Arial Black")


Please note that you can add one font at a time.

 

When using the Add method from the FontNames Collection, the Fonts dropdown will be reset, so the fonts you add will not be appended to the default set, but will rather create a new Fonts set. See the example below:

Default state

Programmatic population




The Fonts dropdown contains the default
set of fonts)
 

(The Fonts dropdown contains only those
added using the Add method)

 

You can also populate the Fonts dropdown using the ToolsFile, as shown in the example below:

ToolsFile.xml Copy Code
<fontNames>
  
<item name="Arial" />
  
<item name="Arial Narrow" />
  
<item name="Arial Black" />
</
fontNames>

 

Please bear in mind that Telerik RadEditor will persist its state (including the Fonts set) between postbacks. In order to create a new set of Fonts (e.g. for different users), you will need to clear it first. This can be done using the Remove method of the the FontNames collection.
 

See Also