Font Name Dropdown Customization
The Font Name dropdown of CuteEditor by default displays a predefined set of
font names. You can easily modify this default set using the following methods.
1. Edit Dropdown Configuration File (Common.config).
The dropdown configuration file (Common.config) can be found in the
/CuteEditor/Configuration/Shared folder. In dropdown configuration file you can
find the FontName element which contains the configuration information for
the Font Name dropdown within CuteEditor. By default, it contains the
following font names:
You can modify the FontName element to create your own font name list.
Example:
- <FontName>
- <item text="Arial" html="<font size=3 face='Arial'>Arial</font>">Arial</item>
- <item text="Verdana" html="<font size=3 face='Verdana'>Verdana</font>">Verdana</item>
- <item text="Comic Sans MS" html="<font size=3 face='Comic Sans MS'>Comic Sans MS</font>">Comic Sans MS</item>
- <item text="Courier" html="<font size=3 face='Courier'>Courier</font>">Courier</item>
- <item text="Georgia" html="<font size=3 face='Georgia'>Georgia</font>">Georgia</item>
- <item text="Impact" html="<font size=3 face='Arial'>Impact</font>">Impact</item>
- <item text="Lucida Console" html="<font size=3 face='Lucida Console'>Lucida Console</font>">Lucida Console</item>
- <item text="Tahoma" html="<font size=3 face='Tahoma'>Tahoma</font>">Tahoma</item>
- <item text="Times New Roman" html="<font size=3 face='Times New Roman'>Times New Roman</font>">Times New Roman</item>
- <item text="Wingdings" html="<font size=3 >Wingdings</font>">Wingdings</item>
- </FontName>
2. Programmatically Populate the Font Name
C# Example:
- if (!IsPostBack) {
- CuteEditor.ToolControl toolctrl=Editor1.ToolControls["FontName"];
- if(toolctrl!=null) {
- CuteEditor.RichDropDownList dropdown=(CuteEditor.RichDropDownList)toolctrl.Control;
-
- CuteEditor.RichListItem richitem=dropdown.Items[0];
-
- dropdown.Items.Clear();
-
- dropdown.Items.Add(richitem);
-
- dropdown.Items.Add("Arial");
-
- dropdown.Items.Add("Verdana","Verdana");
-
- dropdown.Items.Add("<span style='font-family:Tahoma;font-size:12pt'>Tahoma</span>","Tahoma","Tahoma");
- }
- }
VB Example:
- If Not Page.IsPostBack Then
- If Not Editor1.ToolControls("FontName") Is Nothing Then
- Dim dropdown As CuteEditor.RichDropDownList
- Dim richitem As CuteEditor.RichListItem
- dropdown = DirectCast(Editor1.ToolControls("FontName").Control, CuteEditor.RichDropDownList)
-
- richitem = dropdown.Items(0)
-
- dropdown.Items.Clear()
-
- dropdown.Items.Add(richitem)
-
- dropdown.Items.Add("Arial")
-
- dropdown.Items.Add("Verdana","Verdana")
-
- dropdown.Items.Add("<span style='font-family:Tahoma;font-size:12pt'>Tahoma</span>", "Tahoma", "Tahoma")
- End If
- End If