FontFamily.FamilyTypefaces Property

 
System_CAPS_noteNote

The .NET API Reference documentation has a new home. Visit the .NET API Browser on docs.microsoft.com to see the new experience.

Gets a collection of typefaces for the FontFamily object.

Namespace:   System.Windows.Media
Assembly:  PresentationCore (in PresentationCore.dll)

public FamilyTypefaceCollection FamilyTypefaces { get; }

Property Value

Type: System.Windows.Media.FamilyTypefaceCollection

A FamilyTypefaceCollection that represents a collection of typefaces for the FontFamily object.

<object>
  <object.FamilyTypefaces>
    <OneOrMoreFontFamilyTypefaces/>
  </object.FamilyTypefaces>
</object>

OneOrMoreFontFamilyTypefaces

One or more of typefaces for the FontFamily object.

// Return the font family for the selected font name.
FontFamily fontFamily = new FontFamily("Arial Narrow");

// Return the family typeface collection for the font family.
FamilyTypefaceCollection familyTypefaceCollection = fontFamily.FamilyTypefaces;

// Enumerate the family typefaces in the collection.
foreach (FamilyTypeface typeface in familyTypefaceCollection)
{
    // Add the typeface style values to the styles combo box.
    comboBoxStyles.Items.Add(typeface.Style);
}

comboBoxStyles.SelectedIndex = 0;

.NET Framework
Available since 3.0
Return to top
Show: