Typography.Capitals 屬性

定義

取得或設定 FontCapitals 列舉值,這個值表示所選取之字型的大寫字母形式。

public:
 property System::Windows::FontCapitals Capitals { System::Windows::FontCapitals get(); void set(System::Windows::FontCapitals value); };
public System.Windows.FontCapitals Capitals { get; set; }
member this.Capitals : System.Windows.FontCapitals with get, set
Public Property Capitals As FontCapitals

屬性值

FontCapitals 列舉值。 預設值是 Normal

備註

這個屬性會取得或設定擁有 Typography 屬性的物件上的值,這是存取類別實例的唯一 Typography 方法。 此外,這個屬性支援附加屬性使用方式,以便在 XAML 中的文字包含物件上設定它。

大寫字是一組以大寫樣式字符轉譯文字的印刷格式。 一般而言,當文字全部轉譯為大寫時,字母之間的間距可能太近,字母的加權和比例會過重。 OpenType 支援數種大寫樣式格式,包括小寫字、小寫字大寫、Titling 和大寫間距。 這些樣式格式可讓您控制大寫字的外觀。

下列文字顯示 Pescadero 字型的標準大寫字母,後面接著樣式設定為 "SmallCaps" 和 "AllSmallCaps" 的字母。 在此情況下,三個單字全都使用相同的字型大小。

使用 OpenType 大寫的文字使用 OpenType 大
大寫範例

下列程式碼範例示範如何使用 屬性定義 Pescadero 字型 Capitals 的大寫。 使用 "SmallCaps" 格式時會略過任何開頭的大寫字母。

<Paragraph FontFamily="Pescadero" FontSize="48">
  <Run>CAPITALS</Run>
  <Run Typography.Capitals="SmallCaps">Capitals</Run>
  <Run Typography.Capitals="AllSmallCaps">Capitals</Run>
</Paragraph>

下列程式碼範例可以完成與先前標記範例相同的工作。

MyParagraph.FontFamily = new FontFamily("Pescadero");
MyParagraph.FontSize = 48;

Run run_1 = new Run("CAPITALS ");
MyParagraph.Inlines.Add(run_1);

Run run_2 = new Run("Capitals ");
run_2.Typography.Capitals = FontCapitals.SmallCaps;
MyParagraph.Inlines.Add(run_2);

Run run_3 = new Run("Capitals");
run_3.Typography.Capitals = FontCapitals.AllSmallCaps;
MyParagraph.Inlines.Add(run_3);

MyParagraph.Inlines.Add(new LineBreak());
MyParagraph.FontFamily = New FontFamily("Pescadero")
MyParagraph.FontSize = 48

Dim run_1 As New Run("CAPITALS ")
MyParagraph.Inlines.Add(run_1)

Dim run_2 As New Run("Capitals ")
run_2.Typography.Capitals = FontCapitals.SmallCaps
MyParagraph.Inlines.Add(run_2)

Dim run_3 As New Run("Capitals")
run_3.Typography.Capitals = FontCapitals.AllSmallCaps
MyParagraph.Inlines.Add(run_3)

MyParagraph.Inlines.Add(New LineBreak())

XAML Attribute Usage

<objectTypography.Capitals=「 FontCapitals 」/>

相依性屬性資訊

識別碼欄位 CapitalsProperty
中繼資料屬性設定為 true AffectsMeasure, AffectsRender, Inherits

適用於

另請參閱