Table of Contents

Class LayoutLine

Namespace
DocWright.Core.Rendering
Assembly
DocWright.Core.dll

One laid-out line: the line box layout stacked, the paragraph it belongs to and the document text it holds. It draws nothing.

public sealed class LayoutLine : ILayoutPrimitive
Inheritance
LayoutLine
Implements
Inherited Members

Remarks

Layout emits one for every line it places when source references are on (LayoutEngine.EmitSourceReferences, ConvertOptions.EmitSourceReferences), in every context: the body, table cells, headers and footers, text boxes, notes and shape text. An empty paragraph has a line too, so a consumer can put a caret in it. It is emitted before the line's other primitives, so a line's glyph runs follow their line.

The box is the one layout used to stack the line, not the glyphs' ink: it starts at Top, the next line starts below Top + Height, and the text is set within Left and Width, the measure the line was aligned in. A line set around floating objects in segments (one per gap they leave) gives one line per segment; the second and later have ContinuesPreviousLine.

In a turned frame (a vertical table cell) Left, Top, Width and Height are the page rectangle the line box turns into, so after a quarter turn Width is the line's thickness and Height its measure; Baseline is then the baseline's x, and its y otherwise. Inside a TurnScope (a turned shape's text, Phase 181) the line is in the scope's upright frame; Map(double, double, out double, out double) takes its points onto the page.

Renderers ignore it: a PDF or an image is the same bytes with or without it.

Constructors

LayoutLine(Twips, Twips, Twips, Twips, Twips, long, int, bool, bool, GlyphOrientation, bool, GlyphRunSourceSegment?, GlyphRunSourceSegment?)

Initializes a line.

Properties

Baseline

Gets the baseline: a y, or an x when Orientation is a quarter turn.

ContinuesPreviousLine

Gets a value indicating whether this is the second or a later segment of a line set in segments around floating objects: it shares the first segment's top and baseline.

FirstSegment

Gets the first document text the line holds, in document order (not the visual order of a right-to-left line), or null for a line that holds none: an empty paragraph, or a line of generated text or objects only.

HasText

Gets a value indicating whether the line holds document text.

Height

Gets the height of the line box.

IsLastLine

Gets a value indicating whether this is the paragraph's last line.

IsRightToLeft

Gets a value indicating whether the paragraph runs right to left.

LastSegment

Gets the last document text the line holds, in document order, or null for a line that holds none.

Left

Gets the left edge of the measure the line was set in.

LineIndex

Gets the line's position among its paragraph's lines, from 0, counted across pages and columns. A header or footer paragraph repeats on every page and counts from 0 on each.

Orientation

Gets how the line's frame is turned on the page.

ParagraphKey

Gets the paragraph's node key, the value of its DomNodeId (WordDocument.FindNode turns it back into the paragraph), or 0 when the line belongs to no document paragraph.

Top

Gets the top of the line box.

Width

Gets the width of the measure the line was set in.