PeachDrawing.Text

PeachDrawing.Text.Layout

Paragraph Class

Text prepared for laying out: its direction, scripts and joining resolved, its line break opportunities found. It does not depend on a width, so one paragraph can be laid out at any number of widths.

public sealed class Paragraph

Inheritance System.Object → Paragraph

Remarks

A paragraph is immutable as far as a caller can tell, and safe to lay out from several threads (it remembers the pieces it has shaped, which is not visible). Build one with ParagraphBuilder. The whole text is one bidirectional paragraph with one base direction: text with paragraph separators in it is not split into several, so a caller that wants each of its paragraphs to detect its own direction builds one Paragraph for each. Line widths are found by shaping the words between break opportunities on their own, and the lines are then shaped whole, so a line’s Width can differ slightly from the width it was fitted at where a font kerns across a space.

Properties  
IsRightToLeft Whether the paragraph as a whole runs right to left.
Style The style the paragraph was built with.
Text The text of the paragraph.
Methods  
CreateFlow() Starts laying the paragraph out one line at a time, for a caller that decides how much room each line has (floats, columns, pages): see LineFlow.
Layout(double) Lays the paragraph out at a width.
MeasureContent() The narrowest and the widest the paragraph can be laid out.