Typeface Constructor (String)
.NET Framework 4.5
Initializes a new instance of the Typeface class for the specified font family typeface name.
Namespace: System.Windows.Media
Assembly: PresentationCore (in PresentationCore.dll)
Parameters
- typefaceName
- Type: System.String
The typeface name for the specified font family.
// Return the typeface for the selected font family name. Typeface typeface1 = new Typeface("Verdana"); // Return the typeface for the selected font family name and font values. Typeface typeface2 = new Typeface(new FontFamily("file:///C:\\MyFonts\\#Pericles Light"), FontStyles.Italic, FontWeights.ExtraBold, FontStretches.Condensed); // Return the typeface for the selected font family name, font values, and fallback font family name. Typeface typeface3 = new Typeface(new FontFamily("file:///C:\\MyFonts\\#Pericles"), FontStyles.Italic, FontWeights.ExtraBold, FontStretches.Condensed, new FontFamily("Arial"));
Windows 8, Windows Server 2012, Windows 7, Windows Vista SP2, Windows Server 2008 (Server Core Role not supported), Windows Server 2008 R2 (Server Core Role supported with SP1 or later; Itanium not supported)
The .NET Framework does not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.