Class vdText
- Namespace
- VectorDraw.Professional.vdFigures
- Assembly
- VectorDraw.Professional.dll
Represents a text entity within the VectorDraw document model.
public class vdText : vdFigure, IDisposable, IVDSerialise, IBaseObject
- Inheritance
-
vdText
- Implements
- Derived
- Inherited Members
Examples
// Create a text and add to the model:
var text = new vdText(doc)
{
TextString = "Sample",
InsertionPoint = new gPoint(0, 0, 0),
Height = 5.0,
Rotation = 0.0
};
// Optionally set a style from the document
text.Style = doc.TextStyles.Standard;
// Enable a filled background mask
text.BackGroundMask = true;
text.BackGroundMaskColor = new vdColor(System.Drawing.Color.Yellow);
// Insert into the model
doc.Model.Entities.AddItem(text);
doc.Redraw(false);
Remarks
The vdText class implements rendering and geometry logic for text:
- Text metrics and layout are provided by the associated vdTextstyle (accessed via the Style property).
- Supports world-space placement via InsertionPoint, rotation via Rotation,
scaling via Height and WidthFactor, and extrusion via ExtrusionVector and Thickness. - Provides advanced features such as AlignToView drawing (screen-aligned text), background masking (BackGroundMask and BackgroundMaskBorder),
justification, under/over/strikethrough lines and SHX/TTF handling used by the renderer. - Many properties raise document modification events and maintain history for undo/redo support.
- The class exposes utilities to supply grip/osnap points for editing.
Constructors
- vdText()
Initializes the vdText object.
- vdText(vdDocument)
Initializes a new instance of the vdText object and registers it to the passed Document.
- vdText(vdDocument, string, gPoint, double)
Initializes a new instance of the vdText object and registers it to the passed Document.
- vdText(vdDocument, string, gPoint, double, VdConstHorJust, VdConstVerJust, vdTextstyle)
Initializes a new instance of the vdText object and registers it to the passed Document.
Properties
- AlignToView
A boolean value that defines if the plane of the object is relative to the current view.
- AlignToViewSize
Get/Set the height of the object in output Device millimeters for positive or hundreds of millimeters for negative.
- AlignmentPoint
Get/Set a point used to stretch the object when HorJustify is Fit or Aligned.
- BackGroundMask
Get/Set a boolean value that represents if the backgroundmask color will be used.
- BackGroundMaskBorderColor
Get/Set the vdColor that the border of the mtext will be drawn.
- BackGroundMaskBorderPenWidth
Get/Set the object's backgroundMaskBorder pen width in drawing units.
- BackGroundMaskColor
Get/Set the vdColor that will fill the box of the mtext.
- BackGroundMaskOffset
Get/Set the object's backgroundMask offset.
- BackgroundMaskBorder
Get/Set a boolean value that represents if the BackgroundMaskBorder color will be used.
- Bold
Get/Set a boolean value indicating if the text is bold.
- BoundingBox
Gets the Bounding Box of the vdText object in WorldCoordinate System.
- ECSMatrix
Gets the transformation Matrix that converts coordinates from the object's local coordinate system (object coordinate system, OCS) to the World Coordinate System (WCS).
- ExtraOveride
Extra draw properties for the text.
- ExtrusionVector
Get/Set the 3D vector extrusion direction for the object.
- Flag
Get/Set a flag indicating how the letters of the text will be drawn(upsidedown,backward etc...).
- Height
Get/Set the height of the text in drawing units.
- HorJustify
Get/Set the horizontal justification of the text.
- InsertionPoint
Get/Set the Insertion point of the text in World Coordinate System(WCS).
- ObliqueAngle
Oblique angle for the text in degrees.
- Rotation
Get/Set the rotation of the text in radians.
- Style
Get/Set the vdTextstyle object of the vdText.
- TextBox
It is the bounding box of the text in Entity Coordinate System(ECS) before the ECS Matrix is applied.
- TextLine
Specifies if any lines will be drawn with the text using grTextStyleExtra.TextLineFlags flag.
- TextString
Get/Set the string that the vdText object will draw.
- Thickness
Get/Set the object's thickness in Drawing Units.
- VerJustify
Get/Set the vertical Justification of the text.
- WidthFactor
Get/Set a value used to stretch the vdText object by changing it's width.
Methods
- CreateExtra()
Creates new grTextStyleExtra object for the vdText object.These values can ovewrite the style's values.
- DeSerialize(DeSerializer, string, object)
This Function is called foreach field name of the vdText object when opening in vdml format.
- Draw(vdRender)
Called in order to draw the object in a specified vdRender object.
- DrawGrip(int, Box, vdRender)
Overriden function in order to draw the center move grip differently.
- Explode()
Explodes the vdText object into a vdPolyHarch object for TTF fonts or into a collection of vdLine objects for SHX fonts.
- GetBackgroundBorderPolyline()
Calculates and returns a vdPolyline used when BackgroundMaskBorder is true.
- GetBackgroundPolyline()
Calculates and returns a vdPolyline used when BackGroundMask is true.
- GetCompareHash()
Returns a unique 32 bit integer value according to the object type and its properties values
- GetDisplayString()
Gets the string that is displayed.
- GetGripPoints()
A function returning the grip points of the object.
- GetTableDependecies(vdTableDependeciesArgs)
Fills the passed vdTableDependeciesArgs args with all the table references of this object (vdLayer, vdBlock, vdDimstyle, vdLineType, vdTextstyle, vdImageDef, vdHatchPattern etc).
- GetValidGripPointsItems()
Returns the number of valid grip points of the object. Must return the same number of points as the GetGripPoints() method.
- InitializeProperties()
Resets the properties of the vdText object to the Default values.
- Invalidate()
Invalidates the object's Bounding Box and causes the control to be redrawn in this region.
- IsUnderline()
Get a boolean value indicating if the line under the text is drawn.
- MatchProperties(vdPrimary, vdDocument)
Matches all the common properties from an object and sets them to this object.
- MoveGripPointsAt(Int32Array, double, double, double)
This function is intended to be called during a grip edit of the object.
- OnDocumentSelected(vdDocument)
This method is called when the object is inserted in a Document for the first time.
- Serialize(Serializer)
This Function is called when saving the vdText object to vdml format.
- ToString()
Gets a System.String that represents the type of the vdText Object.
- Transformby(Matrix)
Transforms all geometrical properties of this object by the specified Matrix.
- Update()
Updates the object after change of properties.
- getOsnapPoints(Matrix, OsnapMode, gPoint, gPoint, int, OsnapPoints)
Overrrides the getOsnapPoints(Matrix, OsnapMode, gPoint, gPoint, int, OsnapPoints).