protected void Page_Init(object sender, EventArgs e)
 {
     ddbPARAM_CODE_REPORT_CHINESE_FONT.Items.Add(new ListItem(string.Empty, string.Empty));
     foreach (string fontName in fontList)
     {
         System.Drawing.FontFamily chineseFontFamily = null;
         try
         {
             chineseFontFamily = new System.Drawing.FontFamily(fontName);
         }
         catch { }
         if (chineseFontFamily != null)
         {
             if (ddbPARAM_CODE_REPORT_CHINESE_FONT.Items.FindByValue(chineseFontFamily.Name) == null)
             {
                 ddbPARAM_CODE_REPORT_CHINESE_FONT.Items.Add(new ListItem(chineseFontFamily.GetName(0), chineseFontFamily.Name));
             }
         }
     }
 }
Example #2
0
		public void FontFamily_String ()
		{
			HostIgnoreList.CheckTest ("MonoTests.System.Drawing.FontFamilyTest.FontFamily_String");
			FontFamily ff = new FontFamily (name);
			CheckMono (ff);
			FontStyle style = FontStyle.Bold;
			Assert.AreEqual (ff.Name, ff.GetName (0), "GetName");
			Assert.IsTrue ((ff.GetCellAscent (style) > 0), "GetCellAscent");
			Assert.IsTrue ((ff.GetCellDescent (style) > 0), "GetCellDescent");
			Assert.IsTrue ((ff.GetEmHeight (style) > 0), "GetEmHeight");
			Assert.IsTrue ((ff.GetLineSpacing (style) > 0), "GetLineSpacing");
			Assert.IsTrue (ff.IsStyleAvailable (style), "IsStyleAvailable");
		}