TextBlock.OpticalMarginAlignment TextBlock.OpticalMarginAlignment TextBlock.OpticalMarginAlignment TextBlock.OpticalMarginAlignment Property

Definition

Get or sets a value that indicates how the font is modified to align with fonts of different sizes.

public : OpticalMarginAlignment OpticalMarginAlignment { get; set; }
OpticalMarginAlignment OpticalMarginAlignment();

void OpticalMarginAlignment(OpticalMarginAlignment opticalmarginalignment);
public OpticalMarginAlignment OpticalMarginAlignment { get; set; }
Public ReadWrite Property OpticalMarginAlignment As OpticalMarginAlignment
<TextBlock OpticalMarginAlignment="None"/>
-or-
<TextBlock OpticalMarginAlignment="TrimSideBearings"/>

Property Value

A value of the enumeration that indicates how the font is modified to align at different sizes. The default is None.

Remarks

When OpticalMarginAlignment is set to TrimSideBearings, the text is trimmed to the leftmost stroke of the first character and the rightmost stroke of the last character on a line. For example, an "L" has a small amount of space to the left of the vertical stroke, which scales with font size. When TrimSideBearings is set, the left of the vertical stroke is directly aligned without the spacing. This enables easier alignment to the Windows grid system as explained in Laying out an app page.