FormattedText.SetFontStretch 方法

定義

設定 FormattedText 物件的字型自動縮放值。

多載

SetFontStretch(FontStretch)

設定 FormattedText 物件中整個字元集的字型自動縮放值。

SetFontStretch(FontStretch, Int32, Int32)

設定 FormattedText 物件中所指定字元子集的字型自動縮放值。

SetFontStretch(FontStretch)

設定 FormattedText 物件中整個字元集的字型自動縮放值。

public:
 void SetFontStretch(System::Windows::FontStretch stretch);
public void SetFontStretch (System.Windows.FontStretch stretch);
member this.SetFontStretch : System.Windows.FontStretch -> unit
Public Sub SetFontStretch (stretch As FontStretch)

參數

stretch
FontStretch

要用於文字格式設定的 FontStretch 值。

備註

字型延展值是指在畫面上延展字型的程度。 FontStretch 支援型別轉換行為,讓 類別的 FontStretches 靜態值可用來初始化 FontStretch 和填滿類型的參數 FontStretch 。 您也可以呼叫 FromOpenTypeStretch 來建立已正確初始化的 FontStretch

這個方法會設定整個文字字串的字型延展值。 若要設定文字字串子集的字型延展值,請使用 SetFontStretch(FontStretch, Int32, Int32) 方法。

適用於

SetFontStretch(FontStretch, Int32, Int32)

設定 FormattedText 物件中所指定字元子集的字型自動縮放值。

public:
 void SetFontStretch(System::Windows::FontStretch stretch, int startIndex, int count);
public void SetFontStretch (System.Windows.FontStretch stretch, int startIndex, int count);
member this.SetFontStretch : System.Windows.FontStretch * int * int -> unit
Public Sub SetFontStretch (stretch As FontStretch, startIndex As Integer, count As Integer)

參數

stretch
FontStretch

要用於文字格式設定的 FontStretch 值。

startIndex
Int32

要套用字型自動縮放之初始字元的起始索引。

count
Int32

要套用字型自動縮放的字元數目。

備註

字型延展值是指在畫面上延展字型的程度。

FontStretch 支援型別轉換行為,讓 類別的 FontStretches 靜態值可用來初始化 FontStretch 和填滿類型的參數 FontStretch 。 您也可以呼叫 FromOpenTypeStretch 來建立已正確初始化的 FontStretch

若要設定整個文字字串的字型延展值,請使用 SetFontStretch(FontStretch) 方法。

適用於