本文整理匯總了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
}
示例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);
}
示例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();
}
示例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();
}
示例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;
}