ICanvasTextInlineObject Interface |
Namespace: Microsoft.Graphics.Canvas.Text
public interface ICanvasTextInlineObject
The ICanvasTextInlineObject type exposes the following members.
Name | Description | |
---|---|---|
Baseline | Gets the distance from the top of the object to the point where it is lined up with the adjacent text. | |
BreakAfter | Gets the line-breaking behavior after the inline object. | |
BreakBefore | Gets the line-breaking behavior before the inline object. | |
DrawBounds | Gets the bounds of the parts of the text that would get drawn. | |
Size | Gets the size of the inline object. | |
SupportsSideways | Gets whether the inline object supports being rotated when it's part of vertical text. |
If your app needs to draw some arbitrary graphics together with a text layout, inline objects are a way to do it. Use CanvasTextLayout's SetInlineObject(Int32, Int32, ICanvasTextInlineObject) to set the inline object for a group of characters in a layout.
The Draw callback allows your app to specify some arbitrary drawing behavior, be it graphics, or text, or anything else. The application may choose to store a CanvasDrawingSession within its implementation of ICanvasTextInlineObject, and issue drawing commands to it from the Draw callback.
Inline objects set to characters within a text layout are drawn along with the rest of the text layout. If the inline object overlaps with the text, the inline object will typically appear on top.
The other use for inline objects are custom trimming signs. When a text layout is trimmed, an app may choose the default of truncation, or an ellipsis, or some other arbitrary drawing routine.