InstalledFontCollection ifc = new InstalledFontCollection();
                FontFamily[] ff = ifc.Families;
                int i = 0;
                foreach (FontFamily f in ff)
                {

                    ListItem lt = new ListItem(f.Name.ToString(), f.Name.ToString());
                    if (System.Text.Encoding.GetEncoding("gb2312").GetBytes(lt.Value.Remove(1)).Length == 2)
                    {
                        i++;
                        if (lt.ToString() == Convert.ToString(dt_watermark.Rows[0]["WatermarkFonts"]))
                        {
                            builder.Append("<option value=\"" + lt + "\"  selected='selected'>" + lt + "</option>");
                        }
                        else
                        {
                            builder.Append("<option value=\"" + lt + "\">" + lt + "</option>");
                        }                      
                    }
                }

posted on 2011-06-03 11:26  轻盈  阅读(149)  评论(0编辑  收藏  举报