Typeface Конструкторы

Определение

Инициализирует новый экземпляр класса Typeface.

Перегрузки

Typeface(String)

Инициализирует новый экземпляр класса Typeface, используя указанное имя шрифта в семействе шрифтов.

Typeface(FontFamily, FontStyle, FontWeight, FontStretch)

Инициализирует новый экземпляр класса Typeface для заданного имени семейства шрифтов и значений Style, Weight и Stretch.

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

Инициализирует новый экземпляр класса Typeface для заданного имени семейства шрифтов и значений Style, Weight и Stretch. Кроме того, задается резервное семейство шрифтов.

Typeface(String)

Инициализирует новый экземпляр класса Typeface, используя указанное имя шрифта в семействе шрифтов.

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)

Параметры

typefaceName
String

Имя шрифта для заданного семейства шрифтов.

Примеры

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

Применяется к

Typeface(FontFamily, FontStyle, FontWeight, FontStretch)

Инициализирует новый экземпляр класса Typeface для заданного имени семейства шрифтов и значений Style, Weight и 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)

Параметры

fontFamily
FontFamily

Семейство шрифтов данного шрифта.

style
FontStyle

Стиль шрифта.

weight
FontWeight

Относительная плотность шрифта.

stretch
FontStretch

Степень растяжения шрифта.

Примеры

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

Применяется к

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

Инициализирует новый экземпляр класса Typeface для заданного имени семейства шрифтов и значений Style, Weight и Stretch. Кроме того, задается резервное семейство шрифтов.

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)

Параметры

fontFamily
FontFamily

Семейство шрифтов данного шрифта.

style
FontStyle

Стиль шрифта.

weight
FontWeight

Относительная плотность шрифта.

stretch
FontStretch

Степень растяжения шрифта.

fallbackFontFamily
FontFamily

Семейство шрифтов, используемое, когда встречается символ, который не может быть отображен основным семейством шрифтов (заданным в параметре fontFamily).

Примеры

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

Комментарии

fallbackFontFamily Передача null параметра приводит к отображению символов поля для символов, не включенных в основное семейство шрифтов.

Применяется к