Class CadMTextContent
- Namespace
- OpenCAD2D
- Assembly
- OpenCAD2D.Core.dll
The words of an MTEXT read into paragraphs of runs of one look, and written back in AutoCAD's inline codes. Reading takes
every code AutoCAD 2021 writes: \P (and the column and dimension breaks \N, \X) between paragraphs,
\L \l \O \o \K \k the lines under, over and through, \f and \F the fonts, \C and \c the
colours, \H the height (x after it a factor of the height before), \Q, \T, \W the
slant, spacing and width, \A the alignment in the line, \p the paragraph, braces around a look of its own,
\ { } the letters themselves, ~ a hard space; stacks (\S), symbols (%%d, %%p,
%%c, \U+2248) and codes not known are kept as written, each one run.
public sealed class CadMTextContent
- Inheritance
-
CadMTextContent
- Inherited Members
Remarks
Writing gives each run that is not Plain its codes as AutoCAD writes them: a font, colour,
height, slant, spacing, width or alignment in braces, {\fArial|b1|i0|c0|p34;Bold}, {\C1;red},
{\H1.5x;tall} (the height a factor of the MTEXT's), and the lines alone as \Lunder\l,
\Oover\o, \Kthrough\k; paragraphs after \P, each with \pxqc; where its alignment differs from
the paragraph before it. "AB CD" of an MTEXT 2.5 high with CD bold in Arial writes AB {\fArial|b1|i0|c0|p34;CD}.
Properties
- IsOneLook
Gets whether every run is Plain but for one font, slant or width set before the first letter, and no paragraph is aligned: what a drawing of the words in one look shows whole.
- Paragraphs
Gets the paragraphs, at least one.
- PlainText
Gets the letters as shown, the paragraphs separated by line feeds.
Methods
- Of(IEnumerable<CadMTextParagraph>)
Makes the content of paragraphs.
- Parse(string, double)
Reads the words of an MTEXT as its group 1 and 3 write them. A height set to the MTEXT's own is read as no height, so that
{\H2.5;A}of an MTEXT 2.5 high is plain.
- Parse(string, double, double)
Reads the words as Parse(string, double) does, for laying them out: a width factor in times (
W1.2x;) before any other is times the style's, 0.9 in a style of 0.75.
- Write(double, char)
Writes the content in AutoCAD's codes, as the class says.