Typography.NumeralAlignment 屬性

定義

取得或設定 FontNumeralAlignment 列舉值,指出使用數字時的寬度對齊方式。

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

屬性值

FontNumeralAlignment 列舉值。 預設值是 Normal

備註

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

OpenType 字型支援比例和表格式圖表功能,以在使用數位時控制寬度的對齊方式。 比例圖會將每個數位視為寬度不同 - “1” 小於 “5”。 表格式數字則視為等寬數字,以便垂直對齊,可提高財務類資訊的可讀性。

下列文字在第一個資料行中顯示使用 Miramonte 字型的兩個調和間距數字。 請注意數字 "5" 和 "1" 之間的寬度差異。 第二個資料行顯示相同的兩個數值,使用表格式數字功能調整其寬度。

使用 OpenType 比例的文字 & 表格式圖
比例和索引標籤圖表的範例

下列程式代碼範例示範如何使用 屬性定義 Miramonte 字型 NumeralAlignment 的成比例和表格式圖形。

<TextBlock FontFamily="Miramonte">
  <Run Typography.NumeralAlignment="Proportional">114,131</Run>
</TextBlock>
<TextBlock FontFamily="Miramonte">
  <Run Typography.NumeralAlignment="Tabular">114,131</Run>
</TextBlock>

XAML Attribute Usage

<objectTypography.NumericalAlignment=“FontNumeralAlignment”/>

相依性屬性資訊

標識元欄位 NumeralAlignmentProperty
設定為的元數據屬性 true AffectsMeasure, AffectsRender, Inherits

適用於

另請參閱