語言

Typography.NumeralStyle 屬性

定義

取得或設定一個 FontNumeralStyle 列舉值,決定用於呈現數字替代字型形式的字形集合。

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

屬性值

FontNumeralStyle列舉值。 預設值為 Normal。

備註

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

OpenType 字型支援舊樣式數字格式。 此格式適用於顯示樣式不再標準的數字。 下列文字使用 Palatino Linotype 字型的標準和舊樣式數字格式顯示 18 世紀的日期。

使用 OpenType 舊式數字的標準與舊式數字範例

下列文字顯示 Palatino Linotype 字型的標準數字,後面接著舊式數字。

使用 OpenType 的文字 舊式數字集 標準與舊式數字組範例

以下程式碼範例展示了如何利用 NumeralStyle 屬性為 Palatino Linotype 字型定義舊式數字。

<Paragraph FontFamily="Palatino Linotype">
  <Run Typography.NumeralStyle="Normal">1234567890</Run>
  <Run Typography.NumeralStyle="OldStyle">1234567890</Run>
</Paragraph>

XAML 屬性使用方式

< 物件Typography.NumeralStyle=“FontNumeralStyle”/>

相依財產資訊

Item 價值觀
識別碼欄位 NumeralStyleProperty
元資料屬性設為 true AffectsMeasure、AffectsRender、Inherits

適用於

另請參閱