AND TO PLAY MORE WITH IT , ON SELECTION CHANGE , CHANGE THE FONT OF DESIRED ELEMENT , DO THIS :
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title></title>
<style type="text/css" id="styleMaker" runat="server"></style>
</head>
<body>
<form id="form1" runat="server">
<table style="width:100%;">
<tr>
<td>
<asp:DropDownList ID="ddlFfamily" runat="server" AutoPostBack="True" OnSelectedIndexChanged="ddlFfamily_SelectedIndexChanged"></asp:DropDownList>
</td>
<td><h1 id="H1" runat="server">Hellow I am your Body Font =D</h1></td>
</tr>
</table>
</form>
</body>
</html>
AND IN CODE-BEHIND :
protected void Page_Load(object sender, EventArgs e)
{
var fonts = new InstalledFontCollection();
foreach (FontFamily font in fonts.Families)
{
ddlFfamily.Items.Add(font.Name);
}
foreach (ListItem item in ddlFfamily.Items)
{
styleMaker.InnerHtml += "." + Regex.Replace(item.Value.Trim(), @"\s+", "") + "{font-family:'" + item.Value + "';}";
item.Attributes.Add("class", Regex.Replace(item.Value.Trim(), @"\s+", ""));
}
}
protected void ddlFfamily_SelectedIndexChanged(object sender, EventArgs e)
{
H1.Attributes.Add("style","font-family:'"+ddlFfamily.SelectedItem.Text+"'");
}
PROOF :