FormattedText.SetFontTypeface FormattedText.SetFontTypeface FormattedText.SetFontTypeface Method

Definition

Sets the font typeface for the FormattedText object.

Overloads

SetFontTypeface(Typeface) SetFontTypeface(Typeface) SetFontTypeface(Typeface)

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

SetFontTypeface(Typeface, Int32, Int32) SetFontTypeface(Typeface, Int32, Int32) SetFontTypeface(Typeface, Int32, Int32)

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

SetFontTypeface(Typeface) SetFontTypeface(Typeface) 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

Parameters

typeface
Typeface 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.

SetFontTypeface(Typeface, Int32, Int32) SetFontTypeface(Typeface, Int32, Int32) 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

Parameters

typeface
Typeface Typeface Typeface

The Typeface to use for text formatting.

startIndex
Int32 Int32 Int32

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

count
Int32 Int32 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