Typography.StandardLigatures 屬性
定義
重要
部分資訊涉及發行前產品,在發行之前可能會有大幅修改。 Microsoft 對此處提供的資訊,不做任何明確或隱含的瑕疵擔保。
取得或設定值,該值表示是否啟用標準連字。
public:
property bool StandardLigatures { bool get(); void set(bool value); };
public bool StandardLigatures { get; set; }
member this.StandardLigatures : bool with get, set
Public Property StandardLigatures As Boolean
屬性值
如果啟用標準連字則為 true
,否則為 false
。 預設值是 true
。
備註
這個屬性會取得或設定擁有 Typography
屬性的物件上的值,這是存取類別實例的唯一 Typography 方法。 此外,這個屬性支援附加屬性使用方式,以便在 XAML 中的文字包含物件上設定它。
下列文字顯示 Pericles 字型的標準連音符號字符。
標準連字集的範例
下列程式碼範例示範如何使用 屬性,定義 Pericles 字 StandardLigatures 型的標準 Ligature 字元。
<Paragraph FontFamily="Pericles" Typography.StandardLigatures="True">
<Run Typography.StylisticAlternates="1">FI</Run>
<Run Typography.StylisticAlternates="1">FL</Run>
<Run Typography.StylisticAlternates="1">TH</Run>
<Run Typography.StylisticAlternates="1">TT</Run>
<Run Typography.StylisticAlternates="1">TV</Run>
<Run Typography.StylisticAlternates="1">TW</Run>
<Run Typography.StylisticAlternates="1">TY</Run>
<Run Typography.StylisticAlternates="1">VT</Run>
<Run Typography.StylisticAlternates="1">WT</Run>
<Run Typography.StylisticAlternates="1">YT</Run>
</Paragraph>
根據預設,WPF 中的 OpenTypes 字型會啟用標準連字。 例如,如果您使用 Palatino Linotype 字型,標準連音符號 "fi"、"ff" 和 "fl" 會顯示為合併的字元字符。 請注意,每個標準連音符號的成對字元都彼此相鄰。
預設啟用的標準連字範例
不過,您可以停用標準連音符號功能,讓 "ff" 等標準連音符號顯示為兩個分開的字符,而不是合併的字元字符。
已停用標準連字的範例
下列程式碼範例示範如何使用 屬性來停用 Pala以 Linotype 字 StandardLigatures 型的標準 Ligature 字元。
<!-- Set standard ligatures to false in order to disable feature. -->
<Paragraph Typography.StandardLigatures="False" FontFamily="Palatino Linotype" FontSize="72">
fi ff fl
</Paragraph>
如果 的值為 StandardLigatures true
,且選取的字型不支援標準連字,則會顯示字母的預設格式。
XAML Attribute Usage
<object Typography.StandardLigatures="bool"/>
相依性屬性資訊
識別碼欄位 | StandardLigaturesProperty |
中繼資料屬性設定為 true |
AffectsMeasure、AffectsRender、Inherits |