FormattedText.SetFontTypeface 方法
定義
重要
部分資訊涉及發行前產品,在發行之前可能會有大幅修改。 Microsoft 對此處提供的資訊,不做任何明確或隱含的瑕疵擔保。
設定物件的 FormattedText 字型。
多載
| 名稱 | Description |
|---|---|
| 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代表 、 FontFamily、 FontWeight和 FontStyle的組合FontStretch。 Typeface支援多個建構子,其中一個基於字體名稱構造,另一個則取離散值 FontFamily、 FontWeight、 FontStyleFontStretch和 。
此方法設定整個文字串的字型。 要設定文字字串子集的字型,請使用以下 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代表 、 FontFamily、 FontWeight和 FontStyle的組合FontStretch。 Typeface支援多個建構子,其中一個基於字體名稱構造,另一個則取離散值 FontFamily、 FontWeight、 FontStyleFontStretch和 。
要設定整個文字串的字型,請使用以下 SetFontTypeface(Typeface) 方法。