当前位置: 首页>>代码示例>>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;未经允许,请勿转载。