OpticalMarginAlignment Enum

Definition

Specifies how side bearing values in per-character typography are handled when aligning to a text container boundary.

C#
[Windows.Foundation.Metadata.ContractVersion(typeof(Windows.Foundation.UniversalApiContract), 65536)]
public enum OpticalMarginAlignment
Inheritance
OpticalMarginAlignment
Attributes

Windows requirements

Device family
Windows 10 (introduced in 10.0.10240.0)
API contract
Windows.Foundation.UniversalApiContract (introduced in v1.0)

Fields

Name Value Description
None 0

Use side bearings that come from font typography values. This is the default.

TrimSideBearings 1

Don't use side bearings that come from font typography values, and align the side of the glyph to where the "ink" part of the glyph begins.

Remarks

This enumeration is used as a value by TextBlock.OpticalMarginAlignment and RichTextBlock.OpticalMarginAlignment.

When fonts of different sizes are aligned vertically in the same or nearby containers, the advance width and side bearing of the characters can cause the alignment to appear ragged. This can be prevented by setting a property that uses OpticalMarginAlignment to use the TrimSideBearings constant.

Applies to

Product Versions
WinRT Build 10240, Build 10586, Build 14383, Build 15063, Build 16299, Build 17134, Build 17763, Build 18362, Build 19041, Build 20348, Build 22000, Build 22621, Build 26100

See also