Class DisplayText2
- Namespace
- OpenCAD2D
- Assembly
- OpenCAD2D.Core.dll
A piece of text, placed by the point its alignment names; the canvas measures and draws it in a font.
public sealed class DisplayText2 : DisplayItem2
- Inheritance
-
DisplayText2
- Inherited Members
Constructors
- DisplayText2(string, double, double, double, double, double, int, int, DisplayStyle, string, string, string, double)
Makes a piece of text.
- DisplayText2(string, double, double, double, double, double, int, int, DisplayStyle, string, string, string, double, bool)
Makes a piece of text that may be drawn backwards, as text in a mirrored block is.
Properties
- Bounds
Gets the box that holds the item.
- EstimatedWidth
Gets the width the text is taken to have for picking and extents: of its widest line, by the advances of its letters where it is drawn in an SHX font (Strokes); else from its height and the number of its letters, 0.6 of the height a letter, as a monospace font would, the canvas measuring the real width.
- FontName
Gets the font of the text's style, a typeface or a font file; null for the canvas's own.
- Height
Gets the height of a capital letter.
- Horizontal
Gets where the point lies along the text: 0 left, 1 centre, 2 right.
- IsBackward
Gets whether the text is drawn backwards: laid out and drawn as always in its own frame (along Rotation and up it), that frame then turned over along its baseline, so that the letters run against Rotation and read as in a mirror. A text in a block inserted mirrored, written backwards or upside down is drawn so; a canvas draws it by scaling its frame by -1 along the baseline after turning it.
- IsBold
Gets whether the canvas draws the letters in the bold face of FontName, as a run of an MTEXT coded
|b1is drawn.
- IsField
Gets whether the words are those of a field, which the canvas draws on a grey ground that is not plotted, as AutoCAD does where FIELDDISPLAY is 1; the ground covers the box of the text.
- IsItalic
Gets whether the canvas draws the letters in the italic face of FontName, as a run of an MTEXT coded
|i1is drawn.
- IsQuick
Gets whether the text is shown as its box alone, as AutoCAD shows it where QTEXTMODE is 1: the canvas draws the rectangle that holds its lines, in the text's colour, and not its letters. The words stay for what reads them.
- LineCount
Gets the number of lines of the text.
- Oblique
Gets how far the letters lean, in radians clockwise from upright.
- Parts
Gets what an MTEXT is drawn as, in place of Text drawn whole: its mask (a DisplayFill2) and its frame first, then a text for each run of each line where AutoCAD sets it, in its own font, face, height, width, slant and colour, the parts of a stacked fraction among them, and a line under, over or through a run its codes line and for the bar of a fraction; null for a TEXT, drawn whole. The text keeps its words, height and attachment as one text has them, for what reads it; its box is that of the parts. "AB{\C1;CD}" 2.5 high is drawn as AB in the MTEXT's colour and CD in red after it; "II II II" 20 wide in letters 10 high as "II II" and, 16.67 below it, "II".
- Rotation
Gets the angle of the baseline in radians.
- Strokes
Gets the strokes of the letters where the text is drawn in an SHX font, each a polyline of x, y pairs in the drawing's coordinates, the text's height, width factor, slant, alignment, angle and turning over already taken, then the lines a TEXT's
%%U,%%Kand%%Odraw under, through and over its letters, one segment each; null where the canvas draws the text in FontName.
- Text
Gets the text.
- Vertical
Gets where the point lies up the text: 0 baseline, 1 bottom, 2 middle, 3 top.
- WidthFactor
Gets the width factor.
- X
Gets the X of the alignment point.
- Y
Gets the Y of the alignment point.
Methods
- DistanceTo(double, double)
Gets the distance from a point to the item, the shortest to any part that is drawn; the distance to the nearest edge for a fill, nought inside it.