Click or drag to resize
CanvasTextLayoutLayoutBoundsIncludingTrailingWhitespace Property
Gets a rectangle describing the bounds of text, plus any trailing whitespace.

Namespace:  Microsoft.Graphics.Canvas.Text
Assembly:  Microsoft.Graphics.Canvas (in Microsoft.Graphics.Canvas.dll) Version:
public Rect LayoutBoundsIncludingTrailingWhitespace { get; }

Property Value

Type: Rect

The bounds are relative to the text's layout box. These bounds are in DIPs, and do not take into account any transforms that might be applied while rendering the text.

The location of trailing whitespace is as follows:

Text directionLocation of trailing whitespace
LeftToRightThenTopToBottomAt the right
RightToLeftThenTopToBottomAt the left
LeftToRightThenBottomToTopAt the right
RightToLeftThenBottomToTopAt the left
TopToBottomThenLeftToRightAt the bottom
BottomToTopThenLeftToRightAt the top
TopToBottomThenRightToLeftAt the bottom
BottomToTopThenRightToLeftAt the top

Word wrapping isn't affected by trailing whitespace. To obtain the bounds against which Win2D word-wraps, use LayoutBounds.

See Also