Typography.StylisticAlternates 屬性
定義
重要
部分資訊涉及發行前產品,在發行之前可能會有大幅修改。 Microsoft 對此處提供的資訊,不做任何明確或隱含的瑕疵擔保。
取得或設定值,指定文體替代表單的索引。
public:
property int StylisticAlternates { int get(); void set(int value); };
public int StylisticAlternates { get; set; }
member this.StylisticAlternates : int with get, set
Public Property StylisticAlternates As Integer
屬性值
風格交替的索引形式。 預設值為 0 (零)。
備註
這個屬性會取得或設定一個擁有該 Typography 屬性的物件值,這是存取 Typography 類別實例的唯一方式。 此外,這個屬性支援附加屬性的使用方式,以便在 XAML 中包含文字的物件上設定它。
替代字形是可以取代標準字形的字形。 OpenType 字型,例如以下範例中使用的 Pericles 字型,包含替代字形,可用來創造不同的文字外觀。 下列文字顯示 Pericles 字型的標準字符。
標準字形集合範例
Pericles OpenType 字型包含其他字符,可為標準的字符組提供文體替代字。 下列文字顯示文體替代字符。
風格化替代字形範例
以下程式碼範例展示了如何利用 屬性 StylisticAlternates 定義 Pericles 字型的風格化替代字形。
<Paragraph FontFamily="Pericles">
<Run Typography.StylisticAlternates="1">A</Run>NCIENT
GR<Run Typography.StylisticAlternates="1">EE</Run>K
MYTH<Run Typography.StylisticAlternates="1">O</Run>LOGY
</Paragraph>
下列文字顯示數個 Pericles 字型的其他文體替代字符。
其他風格化替代字形範例
下列程式代碼範例示範如何定義這些其他文體替代字元。
<Paragraph FontFamily="Pericles">
<Run Typography.StylisticAlternates="1">A</Run>
<Run Typography.StylisticAlternates="2">A</Run>
<Run Typography.StylisticAlternates="3">A</Run>
<Run Typography.StylisticAlternates="1">C</Run>
<Run Typography.StylisticAlternates="1">E</Run>
<Run Typography.StylisticAlternates="1">G</Run>
<Run Typography.StylisticAlternates="1">O</Run>
<Run Typography.StylisticAlternates="1">Q</Run>
<Run Typography.StylisticAlternates="1">R</Run>
<Run Typography.StylisticAlternates="2">R</Run>
<Run Typography.StylisticAlternates="1">S</Run>
<Run Typography.StylisticAlternates="1">Y</Run>
</Paragraph>
XAML 屬性使用方式
< 物件Typography.StylisticAlternates=“int”/>
相依財產資訊
| Item | 價值觀 |
|---|---|
| 識別碼欄位 | StylisticAlternatesProperty |
元資料屬性設為 true |
AffectsMeasure、AffectsRender、Inherits |