Adding fonts to Infragistics WebHtmlEditor





5.00/5 (1 vote)
Adding fonts to Infragistics WebHtmlEditor
We can add the fonts to the fonts dropdown in addition to the existing basic fonts. To add 'Times New Roman' to the font names drop down-
ToolbarDropDown ddlFonts = (ToolbarDropDown)infraEditor.FindByKeyOrAction("FontName");
ddlFonts.Items.Add(new ToolbarDropDownItem("Times New Roman","Times New Roman"));
Similarly to add all the windows registered fonts-
ToolbarDropDown ddlFonts = (ToolbarDropDown)infraEditor.FindByKeyOrAction("FontName");
InstalledFontCollection fonts = new InstalledFontCollection();
foreach (FontFamily family in fonts.Families)
{
ddlFonts.Items.Add(new ToolbarDropDownItem(family.Name,family.Name));
}