Windows apps
Collapse the table of content
Expand the table of content
Information
The topic you requested is included in another documentation set. For convenience, it's displayed below. Choose Switch to see the topic in its original location.

Typeface Constructor (String)

 

Initializes a new instance of the Typeface class for the specified font family typeface name.

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

public Typeface(
	string typefaceName
)

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"));

.NET Framework
Available since 3.0
Return to top
Show:
© 2017 Microsoft