Teilen über


Typeface Konstruktoren

Definition

Initialisiert eine neue Instanz der Typeface-Klasse.

Überlädt

Typeface(String)

Initialisiert eine neue Instanz der Typeface-Klasse für den angegebenen Schriftartnamen der Schriftfamilie.

Typeface(FontFamily, FontStyle, FontWeight, FontStretch)

Initialisiert eine neue Instanz der Typeface-Klasse für den angegebenen Namen der Schriftfamilie und die angegebenen Werte von Style, Weight und Stretch.

Typeface(FontFamily, FontStyle, FontWeight, FontStretch, FontFamily)

Initialisiert eine neue Instanz der Typeface-Klasse für den angegebenen Namen der Schriftfamilie und die angegebenen Werte von Style, Weight und Stretch. Außerdem wird eine Fallback-Schriftfamilie angegeben.

Typeface(String)

Initialisiert eine neue Instanz der Typeface-Klasse für den angegebenen Schriftartnamen der Schriftfamilie.

public:
 Typeface(System::String ^ typefaceName);
public Typeface (string typefaceName);
new System.Windows.Media.Typeface : string -> System.Windows.Media.Typeface
Public Sub New (typefaceName As String)

Parameter

typefaceName
String

Der Schriftartname für die angegebene Schriftfamilie.

Beispiele

// 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"));
' Return the typeface for the selected font family name.
Dim typeface1 As New Typeface("Verdana")

' Return the typeface for the selected font family name and font values.
Dim typeface2 As 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.
Dim typeface3 As New Typeface(New FontFamily("file:///C:\MyFonts\#Pericles"), FontStyles.Italic, FontWeights.ExtraBold, FontStretches.Condensed, New FontFamily("Arial"))

Gilt für:

Typeface(FontFamily, FontStyle, FontWeight, FontStretch)

Initialisiert eine neue Instanz der Typeface-Klasse für den angegebenen Namen der Schriftfamilie und die angegebenen Werte von Style, Weight und Stretch.

public:
 Typeface(System::Windows::Media::FontFamily ^ fontFamily, System::Windows::FontStyle style, System::Windows::FontWeight weight, System::Windows::FontStretch stretch);
public Typeface (System.Windows.Media.FontFamily fontFamily, System.Windows.FontStyle style, System.Windows.FontWeight weight, System.Windows.FontStretch stretch);
new System.Windows.Media.Typeface : System.Windows.Media.FontFamily * System.Windows.FontStyle * System.Windows.FontWeight * System.Windows.FontStretch -> System.Windows.Media.Typeface
Public Sub New (fontFamily As FontFamily, style As FontStyle, weight As FontWeight, stretch As FontStretch)

Parameter

fontFamily
FontFamily

Die Schriftfamilie der Schriftart.

style
FontStyle

Der Schriftschnitt der Schriftart.

weight
FontWeight

Die relative Schriftbreite der Schriftart.

stretch
FontStretch

Der Grad der Schriftstreckung der Schriftart.

Beispiele

// 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"));
' Return the typeface for the selected font family name.
Dim typeface1 As New Typeface("Verdana")

' Return the typeface for the selected font family name and font values.
Dim typeface2 As 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.
Dim typeface3 As New Typeface(New FontFamily("file:///C:\MyFonts\#Pericles"), FontStyles.Italic, FontWeights.ExtraBold, FontStretches.Condensed, New FontFamily("Arial"))

Gilt für:

Typeface(FontFamily, FontStyle, FontWeight, FontStretch, FontFamily)

Initialisiert eine neue Instanz der Typeface-Klasse für den angegebenen Namen der Schriftfamilie und die angegebenen Werte von Style, Weight und Stretch. Außerdem wird eine Fallback-Schriftfamilie angegeben.

public:
 Typeface(System::Windows::Media::FontFamily ^ fontFamily, System::Windows::FontStyle style, System::Windows::FontWeight weight, System::Windows::FontStretch stretch, System::Windows::Media::FontFamily ^ fallbackFontFamily);
public Typeface (System.Windows.Media.FontFamily fontFamily, System.Windows.FontStyle style, System.Windows.FontWeight weight, System.Windows.FontStretch stretch, System.Windows.Media.FontFamily fallbackFontFamily);
new System.Windows.Media.Typeface : System.Windows.Media.FontFamily * System.Windows.FontStyle * System.Windows.FontWeight * System.Windows.FontStretch * System.Windows.Media.FontFamily -> System.Windows.Media.Typeface
Public Sub New (fontFamily As FontFamily, style As FontStyle, weight As FontWeight, stretch As FontStretch, fallbackFontFamily As FontFamily)

Parameter

fontFamily
FontFamily

Die Schriftfamilie der Schriftart.

style
FontStyle

Der Schriftschnitt der Schriftart.

weight
FontWeight

Die relative Schriftbreite der Schriftart.

stretch
FontStretch

Der Grad der Schriftstreckung der Schriftart.

fallbackFontFamily
FontFamily

Die Schriftfamilie, die verwendet wird, wenn ein Zeichen auftritt, das von der primären Schriftfamilie (vom fontFamily-Parameter angegeben) nicht dargestellt werden kann.

Beispiele

// 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"));
' Return the typeface for the selected font family name.
Dim typeface1 As New Typeface("Verdana")

' Return the typeface for the selected font family name and font values.
Dim typeface2 As 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.
Dim typeface3 As New Typeface(New FontFamily("file:///C:\MyFonts\#Pericles"), FontStyles.Italic, FontWeights.ExtraBold, FontStretches.Condensed, New FontFamily("Arial"))

Hinweise

Wenn Sie für den fallbackFontFamily Parameter übergeben null werden, werden Feldzeichen für Zeichen angezeigt, die nicht in der primären Schriftfamilie enthalten sind.

Gilt für: