當前位置: 首頁>>代碼示例>>C#>>正文


C# InstalledFontCollection.Dispose方法代碼示例

本文整理匯總了C#中System.Drawing.Text.InstalledFontCollection.Dispose方法的典型用法代碼示例。如果您正苦於以下問題:C# InstalledFontCollection.Dispose方法的具體用法?C# InstalledFontCollection.Dispose怎麽用?C# InstalledFontCollection.Dispose使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在System.Drawing.Text.InstalledFontCollection的用法示例。


在下文中一共展示了InstalledFontCollection.Dispose方法的5個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。

示例1: Dispose_Family

		public void Dispose_Family ()
		{
			InstalledFontCollection ifc = new InstalledFontCollection ();
			int count = ifc.Families.Length;
			ifc.Dispose ();
			Assert.AreEqual (count, ifc.Families.Length, "Families");
			// there is *no* exception here
		}
開發者ID:nlhepler,項目名稱:mono,代碼行數:8,代碼來源:InstalledFontCollectionTest.cs

示例2: DefaultFontsControl

		private bool m_fNewRendering = false;	// the writing system rendering has changed.
		#endregion

		#region Constructor/destructor
		/// ------------------------------------------------------------------------------------
		/// <summary>
		/// Initializes a new instance of the <see cref="T:DefaultFontsControl"/> class.
		/// </summary>
		/// ------------------------------------------------------------------------------------
		public DefaultFontsControl()
		{
			// This call is required by the Windows.Forms Form Designer.
			InitializeComponent();

			// Fill in the font selection combo boxes.
			InstalledFontCollection installedFontCollection = new InstalledFontCollection();
			FontFamily[] fontFamilies = installedFontCollection.Families;
			int count = fontFamilies.Length;
			for (int i = 0; i < count; ++i)
			{
				// The .NET framework is unforgiving of using a font that doesn't support the
				// "regular"  style.  So we won't allow the user to even see them...
				if (fontFamilies[i].IsStyleAvailable(FontStyle.Regular))
				{
					string familyName = fontFamilies[i].Name;
					cbDefaultNormalFont.Items.Add(familyName);
					cbDefaultHeadingFont.Items.Add(familyName);
					cbDefaultPubFont.Items.Add(familyName);
					fontFamilies[i].Dispose();
				}
			}
			installedFontCollection.Dispose();

			// Add our event handlers.
			cbDefaultNormalFont.SelectedIndexChanged +=
				new EventHandler(cbDefaultNormalFont_SelectedIndexChanged);
			m_defaultFontFeaturesBtn.FontFeatureSelected +=
				new EventHandler(m_defaultFontFeatures_FontFeatureSelected);
			cbDefaultHeadingFont.SelectedIndexChanged +=
				new EventHandler(cbDefaultHeadingFont_SelectedIndexChanged);
			m_headingFontFeaturesBtn.FontFeatureSelected +=
				new EventHandler(m_headingFontFeatures_FontFeatureSelected);
			cbDefaultPubFont.SelectedIndexChanged +=
				new EventHandler(cbDefaultPubFont_SelectedIndexChanged);
			m_pubFontFeaturesBtn.FontFeatureSelected +=
				new EventHandler(m_bodyFontFeaturesBtn_FontFeatureSelected);
		}
開發者ID:sillsdev,項目名稱:WorldPad,代碼行數:47,代碼來源:DefaultFontsControl.cs

示例3: loadFonts

        private void loadFonts()
        {
            //獲取係統已經安裝的字體
            InstalledFontCollection MyFont = new InstalledFontCollection();
            FontFamily[] MyFontFamilies = MyFont.Families;
            int Count = MyFontFamilies.Length;
            for (int i = 0; i < Count; i++)
            {
                string FontName = MyFontFamilies[i].Name;
                comboBoxFontName.Items.Add(FontName);
            }

            //並設置Arial為默認字體

            comboBoxFontName.Text = "Arial";
            MyFont.Dispose();
        }
開發者ID:kerwinxu,項目名稱:barcodeManager,代碼行數:17,代碼來源:UserControlVariableText.cs

示例4: FillNumberFontComboList

		/// <summary>
		/// Fill the combobox list which gives the possible fonts for displaying the numbers
		/// of a numbered recursive sequence.
		/// </summary>
		private void FillNumberFontComboList()
		{
			m_cbNumberFont.Items.Add(xWorksStrings.ksUnspecified);
			InstalledFontCollection installedFontCollection = new InstalledFontCollection();
			FontFamily[] fontFamilies = installedFontCollection.Families;
			int count = fontFamilies.Length;
			for (int i = 0; i < count; ++i)
			{
				// The .NET framework is unforgiving of using a font that doesn't support the
				// "regular"  style.  So we won't allow the user to even see them...
				if (fontFamilies[i].IsStyleAvailable(FontStyle.Regular))
				{
					string familyName = fontFamilies[i].Name;
					m_cbNumberFont.Items.Add(familyName);
					fontFamilies[i].Dispose();
				}
			}
			installedFontCollection.Dispose();
		}
開發者ID:sillsdev,項目名稱:WorldPad,代碼行數:23,代碼來源:XmlDocConfigureDlg.cs

示例5: IsFontInstalled

        public bool IsFontInstalled()
        {
            InstalledFontCollection fontCollection = new InstalledFontCollection();

            // Add three font files to the private collection.
            for (int i = 0; i < fontCollection.Families.Length; i++)
            {
                if (fontCollection.Families[i].Name.Equals(this.NameForIphone))
                {
                    fontCollection.Dispose();
                    return true;
                }

            }

            fontCollection.Dispose();
            return false;
        }
開發者ID:nadar71,項目名稱:Krea,代碼行數:18,代碼來源:FontItem.cs


注:本文中的System.Drawing.Text.InstalledFontCollection.Dispose方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。