Επεξεργασία

Κοινή χρήση μέσω


Typography.SlashedZero Property

Definition

Gets or sets a value that indicates whether a nominal zero font form should be replaced with a slashed zero.

public:
 property bool SlashedZero { bool get(); void set(bool value); };
public bool SlashedZero { get; set; }
member this.SlashedZero : bool with get, set
Public Property SlashedZero As Boolean

Property Value

true if slashed zero forms are enabled; otherwise, false. The default value is false.

Remarks

This property gets or sets a value on the object that owns a Typography property, which is the only way to access a Typography class instance. In addition, this property supports an attached property usage so that it can be set on text-containing objects in XAML.

OpenType fonts support a slashed zero numeral format to emphasize the difference between the letter "O" and the numeral "0". The slashed zero numeral is often used for identifiers in financial and business information.

The following text displays a sample order identifier using the Miramonte font. The first line uses standard numerals. The second line used slashed zero numerals to provide better contrast with the uppercase "O" letter.

Text using OpenType slashed zero numerals
Example of slashed zero numerals

The following code example shows how to define slashed zero numerals for the Miramonte font, using the SlashedZero property.

<Paragraph FontFamily="Miramonte">
  <Run>Order #0048-OTC-390</Run>
  <LineBreak/>
  <Run Typography.SlashedZero="True">Order #0048-OTC-390</Run>
</Paragraph>

If the value of SlashedZero is true and the selected font does not support slashed zero forms, the default form of the numeral is displayed.

XAML Attribute Usage

<object Typography.SlashedZero="bool"/>

Dependency Property Information

Identifier field SlashedZeroProperty
Metadata properties set to true AffectsMeasure, AffectsRender, Inherits

Applies to

See also