Show / Hide Table of Contents

Class TextStyle

Represents a text style.

Inheritance
System.Object
DxfObject
TableObject
TextStyle
Implements
IHasXData
System.ICloneable
System.IComparable
System.IComparable<TableObject>
System.IEquatable<TableObject>
Inherited Members
TableObject.NameChanged
TableObject.OnNameChangedEvent(String, String)
TableObject.XDataAddAppReg
TableObject.OnXDataAddAppRegEvent(ApplicationRegistry)
TableObject.XDataRemoveAppReg
TableObject.OnXDataRemoveAppRegEvent(ApplicationRegistry)
TableObject.Name
TableObject.IsReserved
TableObject.InvalidCharacters
TableObject.XData
TableObject.IsValidName(String)
TableObject.ToString()
TableObject.CompareTo(Object)
TableObject.CompareTo(TableObject)
TableObject.GetHashCode()
TableObject.Equals(Object)
TableObject.Equals(TableObject)
DxfObject.CodeName
DxfObject.Handle
System.Object.Equals(System.Object, System.Object)
System.Object.GetType()
System.Object.MemberwiseClone()
System.Object.ReferenceEquals(System.Object, System.Object)
Namespace: netDxf.Tables
Assembly: CADability.dll
Syntax
public class TextStyle : TableObject, IHasXData, ICloneable, IComparable, IComparable<TableObject>, IEquatable<TableObject>

Constructors

| Improve this Doc View Source

TextStyle(String)

Initializes a new instance of the TextStyle class.

Declaration
public TextStyle(string font)
Parameters
Type Name Description
System.String font

Text style font file name with full or relative path.

Remarks

The font file name, without the extension, will also be used as the name of the text style.

| Improve this Doc View Source

TextStyle(String, FontStyle)

Initializes a new instance of the TextStyle class exclusively to be used with true type fonts.

Declaration
public TextStyle(string fontFamily, FontStyle fontStyle)
Parameters
Type Name Description
System.String fontFamily

True type font family name.

FontStyle fontStyle

True type font style

Remarks

This constructor is to be use only with true type fonts. The fontFamily value will also be used as the name of the text style.

| Improve this Doc View Source

TextStyle(String, String)

Initializes a new instance of the TextStyle class.

Declaration
public TextStyle(string name, string font)
Parameters
Type Name Description
System.String name

Text style name.

System.String font

Text style font file name with full or relative path.

| Improve this Doc View Source

TextStyle(String, String, FontStyle)

Initializes a new instance of the TextStyle class exclusively to be used with true type fonts.

Declaration
public TextStyle(string name, string fontFamily, FontStyle fontStyle)
Parameters
Type Name Description
System.String name

Text style name.

System.String fontFamily

True type font family name.

FontStyle fontStyle

True type font style

Remarks

This constructor is to be use only with true type fonts.

Fields

| Improve this Doc View Source

DefaultName

Default text style name.

Declaration
public const string DefaultName = "Standard"
Field Value
Type Description
System.String

Properties

| Improve this Doc View Source

BigFont

Gets or sets an Asian-language Big Font file.

Declaration
public string BigFont { get; set; }
Property Value
Type Description
System.String
Remarks

Only ACAD compiled shape SHX fonts are valid for creating Big Fonts.

| Improve this Doc View Source

Default

Gets the default text style.

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

FontFamilyName

Gets or sets the true type font family name.

Declaration
public string FontFamilyName { get; set; }
Property Value
Type Description
System.String
Remarks

When the font family name is manually specified the file font will not be used and it will be set to empty, the font style will also we set to FontStyle.Regular. In this case the font information will be stored in the style extended data when saved to a DXF.
This value is only applicable for true type fonts.

| Improve this Doc View Source

FontFile

Gets or sets the text style font file name.

Declaration
public string FontFile { get; set; }
Property Value
Type Description
System.String
Remarks

When this value is used for true type fonts should be present in the Font system folder.
When the style does not contain any information for the file the font information will be saved in the extended data when saved to a DXF, this is only applicable for true type fonts.

| Improve this Doc View Source

FontStyle

Gets or sets the true type font style.

Declaration
public FontStyle FontStyle { get; set; }
Property Value
Type Description
FontStyle
Remarks

The font style value is ignored and will always return FontStyle.Regular when a font file has been specified.
All styles might or might not be available for the current font family.

| 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

Fixed text height; 0 if not fixed.

| 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

IsVertical

Gets or sets the text is vertical.

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

ObliqueAngle

Gets or sets the font oblique angle in degrees.

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

Owner

Gets the owner of the actual text style.

Declaration
public TextStyles Owner { get; }
Property Value
Type Description
TextStyles
| Improve this Doc View Source

WidthFactor

Gets or sets the text 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.

Methods

| Improve this Doc View Source

Clone()

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

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

A new TextStyle that is a copy of this instance.

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

Clone(String)

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

Declaration
public override TableObject Clone(string newName)
Parameters
Type Name Description
System.String newName

TextStyle name of the copy.

Returns
Type Description
TableObject

A new TextStyle that is a copy of this instance.

Overrides
TableObject.Clone(String)
| Improve this Doc View Source

TrueTypeFontFamilyName(String)

Find the font family name of an specified TTF font file.

Declaration
public static string TrueTypeFontFamilyName(string ttfFont)
Parameters
Type Name Description
System.String ttfFont

TTF font file.

Returns
Type Description
System.String

The font family name of the specified TTF font file.

Remarks

This method will return an empty string if the specified font is not found in its path or the system font folder or if it is not a valid TTF font.

Implements

IHasXData
System.ICloneable
System.IComparable
System.IComparable<T>
System.IEquatable<T>
  • Improve this Doc
  • View Source
In This Article
Back to top Generated by DocFX