This documentation is archived and is not being maintained.
Typeface Class
Visual Studio 2008
Represents a combination of FontFamily, FontWeight, FontStyle, and FontStretch.
Assembly: PresentationCore (in PresentationCore.dll)
// Return the typeface collection for the fonts in the selected URI location. System.Collections.Generic.ICollection<Typeface> typefaces = Fonts.GetTypefaces("file:///C:\\Windows\\Fonts\\#Georgia"); // Enumerate the typefaces in the collection. foreach (Typeface face in typefaces) { // Separate the URI directory source info from the font family name. string[] familyName = face.FontFamily.Source.Split('#'); // Add the font family name, weight, and style values to the typeface combo box. comboBoxTypeface.Items.Add(familyName[familyName.Length - 1] + " " + face.Weight + " " + face.Style); } comboBoxTypeface.SelectedIndex = 0;
Windows 7, Windows Vista, Windows XP SP2, Windows Server 2008 R2, Windows Server 2008, Windows Server 2003
The .NET Framework and .NET Compact Framework do not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.
Show: