Class CadMTextParagraphFormat
- Namespace
- OpenCAD2D
- Assembly
- OpenCAD2D.Core.dll
How a paragraph of an MTEXT is set, as AutoCAD 2021's ruler and Paragraph dialog set it: its indents, tab stops,
paragraph spacing and line spacing, all in drawing units. Read from and written to the paragraph codes AutoCAD writes
(\pxi-3.2,l4,r1.2,b0.8,a1.2,sm2,t6,c8;), which hold from the paragraph they are set in on.
public sealed class CadMTextParagraphFormat : IEquatable<CadMTextParagraphFormat>
- Inheritance
-
CadMTextParagraphFormat
- Implements
- Inherited Members
Remarks
The first line starts at FirstLineIndent, the second and later at HangingIndent, both from
the left of the frame: AutoCAD writes the hanging indent as l and the first line as i, the first line less
the hanging. In an MTEXT 2.5 high a first line at 2 and the rest at 10 write \pxi-3.2,l4;: after x
every value is a number of the MTEXT's heights.
Written after the format of the paragraph before, only what differs is written, in AutoCAD's order (i, l, r, b, a, s, t),
and what goes back to none is written as AutoCAD resets it: \pi0,l0,r0,b0,a0,s*,tz;.
Properties
- Default
Gets the format of a paragraph with no codes: no indents, no stops, no spacing of its own.
- FirstLineIndent
Gets where the first line starts, from the left of the frame: the ruler's upper triangle.
- HangingIndent
Gets where the second and later lines start, from the left of the frame: the ruler's lower triangle.
- LineSpacing
Gets the paragraph's own line spacing: m multiple, e exactly, a at least; nought for the MTEXT's own.
- LineSpacingValue
Gets the value of the line spacing: the factor of a multiple (1.5 for 1.5x), the distance of exactly and at least (2.5 spaces the lines of an MTEXT 2.5 high as 1x does); 1 where the paragraph has none of its own.
- RightIndent
Gets how far the lines stop short of the right of the frame.
- SpaceAfter
Gets the space after the paragraph; nought for none.
- SpaceBefore
Gets the space before the paragraph; nought for none.
- TabStops
Gets the tab stops, by position; past the last, a tab goes to the next multiple of four heights.
Methods
- Read(CadMTextParagraphFormat, string, double)
Reads the paragraph codes of a paragraph, in drawing units, over the format of the paragraph before it: a value after
xis a number of heights, one without is a distance;*andtzreset; other codes are left alone.\pxi-3.2,l4;of an MTEXT 2.5 high starts the first line at 2 and the rest at 10.
- WithIndents(double, double, double)
Gets the format with other indents.
- WithLineSpacing(char, double)
Gets the format with a line spacing of its own, or none.
- WithSpacing(double, double)
Gets the format with other paragraph spacing.
- WithTabStops(IEnumerable<CadMTextTabStop>)
Gets the format with other tab stops, sorted by position; of two at one place the later is kept, as AutoCAD keeps it.
- WriteAfter(CadMTextParagraphFormat, double)
Writes the codes that make this format of the format of the paragraph before, as AutoCAD writes them: only what differs, in the order i, l, r, b, a, s, t, after
xin heights of the MTEXT where a value is not nought. A tab stop at 10 after a paragraph of none, in an MTEXT 2.5 high, writes\pxt4;; going back to none,\ptz;; the same format writes nothing.