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表示 、FontFamilyFontWeight、 FontStyle和FontStretch的组合。 Typeface支持多个构造函数,其中一个构造基于字样名称,另一个构造函数采用离散值,FontFamilyFontWeightFontStyle以及。FontStretch
此方法设置整个文本字符串的字体字样。 若要设置文本字符串子集的字体字样,请使用 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表示 、FontFamilyFontWeight、 FontStyle和FontStretch的组合。 Typeface支持多个构造函数,其中一个构造基于字样名称,另一个构造函数采用离散值,FontFamilyFontWeightFontStyle以及。FontStretch
若要设置整个文本字符串的字体字样,请使用 SetFontTypeface(Typeface) 该方法。