Show / Hide Table of Contents

Class Text

Represents a Text EntityObject.

Inheritance
System.Object
DxfObject
EntityObject
Text
Implements
IHasXData
System.ICloneable
Inherited Members
EntityObject.LayerChanged
EntityObject.OnLayerChangedEvent(Layer, Layer)
EntityObject.LinetypeChanged
EntityObject.OnLinetypeChangedEvent(Linetype, Linetype)
EntityObject.XDataAddAppReg
EntityObject.OnXDataAddAppRegEvent(ApplicationRegistry)
EntityObject.XDataRemoveAppReg
EntityObject.OnXDataRemoveAppRegEvent(ApplicationRegistry)
EntityObject.Reactors
EntityObject.Type
EntityObject.Color
EntityObject.Layer
EntityObject.Linetype
EntityObject.Lineweight
EntityObject.Transparency
EntityObject.LinetypeScale
EntityObject.IsVisible
EntityObject.Normal
EntityObject.Owner
EntityObject.XData
EntityObject.TransformBy(Matrix4)
EntityObject.ToString()
DxfObject.CodeName
DxfObject.Handle
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
System.Object.ReferenceEquals(System.Object, System.Object)
Namespace: netDxf.Entities
Assembly: CADability.dll
Syntax
public class Text : EntityObject, IHasXData, ICloneable

Constructors

| Improve this Doc View Source

Text()

Initializes a new instance of the Text class.

Declaration
public Text()
| Improve this Doc View Source

Text(String)

Initializes a new instance of the Text class.

Declaration
public Text(string text)
Parameters
Type Name Description
System.String text

Text string.

| Improve this Doc View Source

Text(String, Vector2, Double)

Initializes a new instance of the Text class.

Declaration
public Text(string text, Vector2 position, double height)
Parameters
Type Name Description
System.String text

Text string.

Vector2 position

Text Vector2 in world coordinates.

System.Double height

Text height.

| Improve this Doc View Source

Text(String, Vector2, Double, TextStyle)

Initializes a new instance of the Text class.

Declaration
public Text(string text, Vector2 position, double height, TextStyle style)
Parameters
Type Name Description
System.String text

Text string.

Vector2 position

Text Vector2 in world coordinates.

System.Double height

Text height.

TextStyle style

Text TextStyle.

| Improve this Doc View Source

Text(String, Vector3, Double)

Initializes a new instance of the Text class.

Declaration
public Text(string text, Vector3 position, double height)
Parameters
Type Name Description
System.String text

Text string.

Vector3 position

Text Vector3 in world coordinates.

System.Double height

Text height.

| Improve this Doc View Source

Text(String, Vector3, Double, TextStyle)

Initializes a new instance of the Text class.

Declaration
public Text(string text, Vector3 position, double height, TextStyle style)
Parameters
Type Name Description
System.String text

Text string.

Vector3 position

Text Vector3 in world coordinates.

System.Double height

Text height.

TextStyle style

Text TextStyle.

Properties

| Improve this Doc View Source

Alignment

Gets or sets the text alignment.

Declaration
public TextAlignment Alignment { get; set; }
Property Value
Type Description
TextAlignment
| Improve this Doc View Source

DefaultMirrText

Gets or sets if the text will be mirrored when a symmetry is performed, when the current Text entity does not belong to a DXF document.

Declaration
public static bool DefaultMirrText { get; set; }
Property Value
Type Description
System.Boolean
| Improve this Doc View Source

Height

Gets or sets the text height.

Declaration
public double Height { get; set; }
Property Value
Type Description
System.Double
Remarks

Valid values must be greater than zero. Default: 1.0.
When Alignment.Aligned is used this value is not applicable, it will be automatically adjusted so the text will fit in the specified width.

| Improve this Doc View Source

IsBackward

Gets or sets if the text is backward (mirrored in X).

Declaration
public bool IsBackward { get; set; }
Property Value
Type Description
System.Boolean
| Improve this Doc View Source

IsUpsideDown

Gets or sets if the text is upside down (mirrored in Y).

Declaration
public bool IsUpsideDown { get; set; }
Property Value
Type Description
System.Boolean
| Improve this Doc View Source

ObliqueAngle

Gets or sets the font oblique angle.

Declaration
public double ObliqueAngle { get; set; }
Property Value
Type Description
System.Double
Remarks

Valid values range from -85 to 85. Default: 0.0.

| Improve this Doc View Source

Position

Gets or sets Text Vector3 in world coordinates.

Declaration
public Vector3 Position { get; set; }
Property Value
Type Description
Vector3
| Improve this Doc View Source

Rotation

Gets or sets the text rotation in degrees.

Declaration
public double Rotation { get; set; }
Property Value
Type Description
System.Double
| Improve this Doc View Source

Style

Gets or sets the TextStyle.

Declaration
public TextStyle Style { get; set; }
Property Value
Type Description
TextStyle
| Improve this Doc View Source

Value

Gets or sets the text string.

Declaration
public string Value { get; set; }
Property Value
Type Description
System.String
| Improve this Doc View Source

Width

Gets or sets the text width, only applicable for text Alignment.Fit and Alignment.Align.

Declaration
public double Width { get; set; }
Property Value
Type Description
System.Double
Remarks

Valid values must be greater than zero. Default: 1.0.

| Improve this Doc View Source

WidthFactor

Gets or sets the width factor.

Declaration
public double WidthFactor { get; set; }
Property Value
Type Description
System.Double
Remarks

Valid values range from 0.01 to 100. Default: 1.0.
When Alignment.Fit is used this value is not applicable, it will be automatically adjusted so the text will fit in the specified width.

Methods

| Improve this Doc View Source

Clone()

Creates a new Text that is a copy of the current instance.

Declaration
public override object Clone()
Returns
Type Description
System.Object

A new Text that is a copy of this instance.

Overrides
EntityObject.Clone()
| Improve this Doc View Source

OnTextStyleChangedEvent(TextStyle, TextStyle)

Declaration
protected virtual TextStyle OnTextStyleChangedEvent(TextStyle oldTextStyle, TextStyle newTextStyle)
Parameters
Type Name Description
TextStyle oldTextStyle
TextStyle newTextStyle
Returns
Type Description
TextStyle
| Improve this Doc View Source

TransformBy(Matrix3, Vector3)

Moves, scales, and/or rotates the current entity given a 3x3 transformation matrix and a translation vector.

Declaration
public override void TransformBy(Matrix3 transformation, Vector3 translation)
Parameters
Type Name Description
Matrix3 transformation

Transformation matrix.

Vector3 translation

Translation vector.

Overrides
EntityObject.TransformBy(Matrix3, Vector3)
Remarks

When the current Text entity does not belong to a DXF document, the text will use the DefaultMirrText when a symmetry is performed; otherwise, the drawing variable MirrText will be used.
A symmetry around the X axis when the text uses an Alignment.BaseLineLeft, Alignment.BaseLineCenter, Alignment.BaseLineRight, Alignment.Fit or an Alignment.Aligned. A symmetry around the Y axis when the text uses an Alignment.Fit or an Alignment.Aligned.
Matrix3 adopts the convention of using column vectors to represent a transformation matrix.

Events

| Improve this Doc View Source

TextStyleChanged

Declaration
public event Text.TextStyleChangedEventHandler TextStyleChanged
Event Type
Type Description
Text.TextStyleChangedEventHandler

Implements

IHasXData
System.ICloneable
  • Improve this Doc
  • View Source
In This Article
Back to top Generated by DocFX