FormattedText.SetFontTypeface Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
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
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
- 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
.NET
피드백
https://aka.ms/ContentUserFeedback
출시 예정: 2024년 내내 콘텐츠에 대한 피드백 메커니즘으로 GitHub 문제를 단계적으로 폐지하고 이를 새로운 피드백 시스템으로 바꿀 예정입니다. 자세한 내용은 다음을 참조하세요.다음에 대한 사용자 의견 제출 및 보기