Edit

Share via


FormattedText.SetFontTypeface Method

Definition

Sets the font typeface for the FormattedText object.

Overloads

SetFontTypeface(Typeface)

Sets the font typeface for the entire set of characters in the FormattedText object.

SetFontTypeface(Typeface, Int32, Int32)

Sets the font typeface for a specified subset of characters in the FormattedText object.

SetFontTypeface(Typeface)

Sets the font typeface for the entire set of characters in the FormattedText object.

public:
 void SetFontTypeface(System::Windows::Media::Typeface ^ typeface);
public void SetFontTypeface (System.Windows.Media.Typeface typeface);
member this.SetFontTypeface : System.Windows.Media.Typeface -> unit
Public Sub SetFontTypeface (typeface As Typeface)

Parameters

typeface
Typeface

The Typeface to use for text formatting.

Remarks

Typeface represents a combination of FontFamily, FontWeight, FontStyle, and FontStretch. Typeface supports multiple constructors, one of which constructs based on a typeface name, another of which takes discrete values for FontFamily, FontWeight, FontStyle, and FontStretch.

This method sets the font typeface for the entire text string. To set the font typeface for a subset of the text string, use the SetFontTypeface(Typeface, Int32, Int32) method.

Applies to

SetFontTypeface(Typeface, Int32, Int32)

Sets the font typeface for a specified subset of characters in the FormattedText object.

public:
 void SetFontTypeface(System::Windows::Media::Typeface ^ typeface, int startIndex, int count);
public void SetFontTypeface (System.Windows.Media.Typeface typeface, int startIndex, int count);
member this.SetFontTypeface : System.Windows.Media.Typeface * int * int -> unit
Public Sub SetFontTypeface (typeface As Typeface, startIndex As Integer, count As Integer)

Parameters

typeface
Typeface

The Typeface to use for text formatting.

startIndex
Int32

The start index of the initial character to apply the typeface to.

count
Int32

The number of characters to apply the typeface to.

Remarks

Typeface represents a combination of FontFamily, FontWeight, FontStyle, and FontStretch. Typeface supports multiple constructors, one of which constructs based on a typeface name, another of which takes discrete values for FontFamily, FontWeight, FontStyle, and FontStretch.

To set the font typeface for the entire text string, use the SetFontTypeface(Typeface) method.

Applies to