本文整理汇总了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;
}