FormattedText.SetFontTypeface 方法

定義

設定 FormattedText 物件的字型字樣。

多載

SetFontTypeface(Typeface)

設定 FormattedText 物件中整個字元集的字型字樣。

SetFontTypeface(Typeface, Int32, Int32)

設定 FormattedText 物件中所指定字元子集的字型字樣名稱。

SetFontTypeface(Typeface)

設定 FormattedText 物件中整個字元集的字型字樣。

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)

參數

typeface
Typeface

用於文字格式設定的 Typeface

備註

Typeface表示 、 FontWeight FontStyleFontStretch 的組合 FontFamilyTypeface支援多個建構函式,其中一個建構是根據字樣名稱建構,另一個建構會採用 、 FontWeight FontStyle 、 和 FontStretch 的離散值 FontFamily

這個方法會設定整個文字字串的字型字樣。 若要設定文字字串子集的字型字樣,請使用 SetFontTypeface(Typeface, Int32, Int32) 方法。

適用於

SetFontTypeface(Typeface, Int32, Int32)

設定 FormattedText 物件中所指定字元子集的字型字樣名稱。

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)

參數

typeface
Typeface

用於文字格式設定的 Typeface

startIndex
Int32

要套用字樣名稱之初始字元的起始索引。

count
Int32

要套用字樣名稱的字元數目。

備註

Typeface表示 、 FontWeight FontStyleFontStretch 的組合 FontFamilyTypeface支援多個建構函式,其中一個建構是根據字樣名稱建構,另一個建構會採用 、 FontWeight FontStyle 、 和 FontStretch 的離散值 FontFamily

若要設定整個文字字串的字型字型字樣,請使用 SetFontTypeface(Typeface) 方法。

適用於