FormattedText.SetFontTypeface 方法
定義
重要
部分資訊涉及發行前產品,在發行之前可能會有大幅修改。 Microsoft 對此處提供的資訊,不做任何明確或隱含的瑕疵擔保。
設定 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表示 、 FontWeight FontStyle 和 FontStretch 的組合 FontFamily 。 Typeface支援多個建構函式,其中一個建構是根據字樣名稱建構,另一個建構會採用 、 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)
參數
- startIndex
- Int32
要套用字樣名稱之初始字元的起始索引。
- count
- Int32
要套用字樣名稱的字元數目。
備註
Typeface表示 、 FontWeight FontStyle 和 FontStretch 的組合 FontFamily 。 Typeface支援多個建構函式,其中一個建構是根據字樣名稱建構,另一個建構會採用 、 FontWeight FontStyle 、 和 FontStretch 的離散值 FontFamily 。
若要設定整個文字字串的字型字型字樣,請使用 SetFontTypeface(Typeface) 方法。