Click or drag to resize
CanvasTextLayoutLineSpacingMode Property
Specifies how lines are spaced apart.

Namespace:  Microsoft.Graphics.Canvas.Text
Assembly:  Microsoft.Graphics.Canvas (in Microsoft.Graphics.Canvas.dll) Version: 0.0.0.0
Syntax
C#
public CanvasLineSpacingMode LineSpacingMode { get; set; }

Property Value

Type: CanvasLineSpacingMode
Remarks

If this property is set to Default:

  • Leaving LineSpacing at is default value of -1 will keep the default line spacing.
  • Set LineSpacing to any positive quantity to have it affect the line spacing. And, LineSpacing and LineSpacingBaseline are absolute quantities.

If this property is set to Uniform, then the magnitude of the LineSpacing field will affect line spacing. LineSpacing and LineSpacingBaseline are absolute quantities in DIPs.

If this property is set to Proportional, then the magnitude of the LineSpacing field will affect line spacing. LineSpacing and LineSpacingBaseline are amounts by which to scale the default line spacing and line spacing baseline, respectively.

For example, to create a text layout for double-spaced text, use

var format = new CanvasTextFormat();

var textLayout = new CanvasTextLayout("A piece of text", format, layoutWidth, layoutHeight);

textLayout.LineSpacingMode = CanvasLineSpacingMode.Proportional;
textLayout.LineSpacing = 2;

See Also