PeachDrawing.Text
PeachDrawing.Text.Layout
ParagraphStyle Struct
How a paragraph as a whole is set.
public readonly record struct ParagraphStyle : System.IEquatable<PeachDrawing.Text.Layout.ParagraphStyle>
Implements System.IEquatable<ParagraphStyle>
| Constructors | |
|---|---|
| ParagraphStyle() | Creates the default style: the direction detected from the text, aligned at the start, ordinary line breaking, the line height the faces ask for. default(ParagraphStyle) differs only in the direction, which is left to right. |
| Properties | |
|---|---|
| Align | Where lines are aligned. |
| AlignLast | How the last line of the paragraph, and a line that ends in a forced break, are aligned (CSS text-align-last); null is the same as Align, except that justified text starts them at the start. |
| Direction | The direction the paragraph starts in. |
| Ellipsis | What a line that is cut, by MaxLines or TextOverflow, ends with, up to 32 UTF-16 units: null for the ellipsis (U+2026, or three full stops where the face has no such character), and the empty string for nothing at all, so that the line is only cut. |
| HyphenateCharacter | The string a hyphenated line ends with (CSS hyphenate-character), from 1 to 32 UTF-16 units, or null for the hyphen (U+2010) where the face has it and the hyphen-minus otherwise. |
| HyphenateLimitChars | The smallest a hyphenated word and its pieces may be (CSS hyphenate-limit-chars). Counts are of UTF-16 units and must not be negative. The patterns of a language have minimums of their own, which these cannot go below, and a word of more than 128 UTF-16 units is not hyphenated. |
| HyphenateLimitLast | Whether the last full line may end with a hyphenation (CSS hyphenate-limit-last). |
| HyphenateLimitLines | The most lines in a row that may end with a hyphenation (CSS hyphenate-limit-lines), or null for no limit; it must not be negative. |
| HyphenateLimitZone | How much room a line may have left at its end before its last word is hyphenated (CSS hyphenate-limit-zone), in layout units; a word is hyphenated to fill a line only when the unfilled space would be at least this. It is not negative or infinite, and a percentage is the caller’s to resolve. |
| Hyphens | Whether words are broken with a hyphen (CSS hyphens). |
| LineBreak | How CSS word-break and line-break tailor where lines may break. |
| LineHeight | The height of a line as a multiple of the largest font size on it, or null for what the faces themselves ask for (their ascent, descent and line gap). The leading is shared equally above and below. |
| MaxLines | The most lines the paragraph is laid out in (CSS line-clamp), or null for no limit; it must be one or more. Text that does not fit is cut from the last line, which ends with Ellipsis in its place, and IsTruncated says so. The last line is aligned as the last line of a paragraph is. |
| NoWrap | Whether lines are kept from breaking where they do not fit, so that only forced breaks end a line (CSS text-wrap: nowrap). |
| OverflowWrap | What to do with a word that is wider than a line. |
| TabSize | The distance between the tab stops a tab character (U+0009) advances the pen to (CSS tab-size). Stops are measured along the line from the start edge of the paragraph, in the order the text is written, so a tab after right-to-left text in a left-to-right line is placed as if that text were where it is in memory. A tab at the end of a line hangs, like any space there. Justification widens spaces only, so text after a tab in a justified line moves off its stop by what the spaces before it gained. |
| TextIndent | How far lines start from the edge (CSS text-indent). The indent takes room from the line: it breaks earlier, and the line is aligned in what is left. |
| TextJustify | Where a justified line gets its room from (CSS text-justify); it matters only where the alignment is Justify. |
| TextOverflow | What happens to a line that is wider than the width (CSS text-overflow). |