Class DxfText
- Namespace
- GeometryHelper.Dxf
- Assembly
- GeometryHelper.dll
A text of a DXF file, a TEXT of one line or an MTEXT of paragraphs, as DxfReader reads it into Shape: where it stands, which way it faces and reads, how tall it is, and its words.
public sealed class DxfText
- Inheritance
-
DxfText
- Inherited Members
Remarks
A text is the same in the plan and in space, so PlanAs2D reads it as this class either way: it has no twin of the plane. A TEXT 2.5 high reading "Grid A" at (1 000, 500) on the floor is at (1 000, 500, 0), its normal (0, 0, 1) and its rotation nought.
It cannot be changed once made, and two texts are the same only where they are one object: it does not compare its numbers.
Constructors
- DxfText(GeoPoint3, GeoVector3, double, double, string, bool, double, double)
Initializes a text of one's own, to be written by Add(DxfText, string).
Properties
- Height
Gets how tall the letters are (group 40), above nought.
- IsMultiline
Gets whether the text is an MTEXT, of paragraphs; false for a TEXT, of one line.
- Normal
Gets the way the text faces, of unit length: its extrusion (group 210), (0, 0, 1) where the file gives none. A text whose normal is (0, 0, -1) reads mirrored seen from above, as AutoCAD writes the text of a mirrored block.
- Position
Gets where the text stands, in world coordinates: the alignment point of a TEXT, the first (group 10) where it is aligned left on its baseline and where it is aligned or fitted between two points, which start at the first, and the second (11) where it is aligned any other way, centred, right or in the middle, as AutoCAD places it; the insertion point of an MTEXT (10), its attachment saying which corner or side of its paragraphs that is.
- Rotation
Gets how far the text is turned, in radians counter-clockwise about Normal from the x axis of the normal's own system by the arbitrary axis algorithm: a TEXT's group 50 in degrees made radians, an MTEXT's from its direction (group 11) where it has one and from its group 50 in degrees otherwise, as AutoCAD writes it (the DXF reference says radians). It is from nought up to but not including 2 pi, whatever the file gives: a TEXT turned -90 degrees is turned 3 pi / 2. For the normal (0, 0, 1) it is the angle from the x axis: a text reading up the page is turned pi / 2.
- Value
Gets the words: a TEXT's as written, an MTEXT's with its formatting taken out and its paragraphs (\P) a line feed apart. In both, %%c, %%d and %%p (either case) are the diameter (∅, U+2205), degree and plus-minus signs; in a TEXT %%% is a per cent sign and %%nnn the character of the code nnn, which an MTEXT keeps as written, as AutoCAD 2021 does; an MTEXT's
~is the space that does not break, U+00A0; a letter written as an escape,\U+00E9, is the letter, and so is the text\U+0041written in the words, which reads as A, an MTEXT's escapes read before its formatting, as AutoCAD 2021 reads them:\U+0110is a backslash and Đ,\U+005CPa new line; a control character in AutoCAD's caret form, ^J, ^M or ^I, is the character, and^a caret. A TEXT is one line, so a line feed in its words is a space; a carriage return is left out of either.
- Width
Gets how wide an MTEXT's paragraphs run before they wrap (group 41), nought where it gives none; nought for a TEXT.
- WidthFactor
Gets how much wider than its height says its letters are drawn: a TEXT's group 41, 1 where it gives none; 1 for an MTEXT, which sets it in its formatting.
Methods
- ToString()
Gives the text as a line for debugging: its kind, its words, where it stands and its height.