Table of Contents

Class StringFormat

Namespace
Aspose.Imaging
Assembly
Aspose.Imaging.dll

Encapsulates text layout information (such as alignment, orientation and tab stops) display manipulations (such as ellipsis insertion and national digit substitution) and OpenType features. This class cannot be inherited.

public sealed class StringFormat : DisposableObject, IDisposable
Inheritance
StringFormat
Implements
Inherited Members

Constructors

StringFormat()

Initializes a new StringFormat object.

public StringFormat()

StringFormat(StringFormat)

Initializes a new StringFormat object from the specified existing StringFormat object.

public StringFormat(StringFormat format)

Parameters

format StringFormat

The StringFormat object from which to initialize the new StringFormat object.

Exceptions

ArgumentNullException

format is null.

StringFormat(StringFormatFlags)

Initializes a new StringFormat object with the specified StringFormatFlags enumeration and language.

public StringFormat(StringFormatFlags options)

Parameters

options StringFormatFlags

The StringFormatFlags enumeration for the new StringFormat object.

Properties

Alignment

Gets or sets text alignment information on the vertical plane.

public StringAlignment Alignment { get; set; }

Property Value

StringAlignment

A StringAlignment enumeration that specifies text alignment information.

CustomCharIdent

Gets or sets the custom character ident.

public PointF CustomCharIdent { get; set; }

Property Value

PointF

The custom character ident.

DigitSubstitutionLanguage

Gets or sets the language that is used when local digits are substituted for western digits.

public int DigitSubstitutionLanguage { get; set; }

Property Value

int

A National Language Support (NLS) language identifier that identifies the language that will be used when local digits are substituted for western digits. You can pass the LCID property of a CultureInfo object as the NLS language identifier. For example, suppose you create a CultureInfo object by passing the string "ar-EG" to a CultureInfo constructor. If you pass the LCID property of that CultureInfo object along with. Traditional to the Aspose.Imaging.StringFormat.SetDigitSubstitution(System.Int32,Aspose.Imaging.StringDigitSubstitute) method, then Arabic-Indic digits will be substituted for western digits at display time.

Remarks

The setter is introduced for the obsolete method SetDigitSubstitution.

DigitSubstitutionMethod

Gets or sets the method to be used for digit substitution.

public StringDigitSubstitute DigitSubstitutionMethod { get; set; }

Property Value

StringDigitSubstitute

A StringDigitSubstitute enumeration value that specifies how to substitute characters in a string that cannot be displayed because they are not supported by the current font.

Remarks

The setter is introduced for the obsolete method SetDigitSubstitution.

FirstTabOffset

Gets the number of spaces between the beginning of a line of text and the first tab stop.

public float FirstTabOffset { get; }

Property Value

float

The first tab offset.

Remarks

The property is introduced for removed method GetTabStops.

FormatFlags

Gets or sets a StringFormatFlags enumeration that contains formatting information.

public StringFormatFlags FormatFlags { get; set; }

Property Value

StringFormatFlags

A StringFormatFlags enumeration that contains formatting information.

GenericDefault

Gets a generic default StringFormat object.

public static StringFormat GenericDefault { get; }

Property Value

StringFormat

The generic default StringFormat object.

GenericTypographic

Gets a generic typographic StringFormat object.

public static StringFormat GenericTypographic { get; }

Property Value

StringFormat

A generic typographic StringFormat object.

HotkeyPrefix

Gets or sets the HotkeyPrefix object for this StringFormat object.

public HotkeyPrefix HotkeyPrefix { get; set; }

Property Value

HotkeyPrefix

The HotkeyPrefix object for this StringFormat object, the default is None.

LineAlignment

Gets or sets the line alignment on the horizontal plane.

public StringAlignment LineAlignment { get; set; }

Property Value

StringAlignment

A StringAlignment enumeration that represents the line alignment.

TabStops

Gets an array of distances between tab stops in the units specified by the PageUnit property.

public float[] TabStops { get; }

Property Value

float[]

The tab stops.

Remarks

The property is introduced for removed method GetTabStops.

Trimming

Gets or sets the StringTrimming enumeration for this StringFormat object.

public StringTrimming Trimming { get; set; }

Property Value

StringTrimming

A StringTrimming enumeration that indicates how text drawn with this StringFormat object is trimmed when it exceeds the edges of the layout rectangle.

Methods

DeepClone()

Creates a deep clone of this StringFormat object.

public StringFormat DeepClone()

Returns

StringFormat

The deep clone of the current StringFormat.

Equals(object)

Check if objects are equal.

public override bool Equals(object obj)

Parameters

obj object

The other object.

Returns

bool

The equality comparison result.

GetHashCode()

Get hash code of the current object.

public override int GetHashCode()

Returns

int

The hash code.

SetTabStops(float, float[])

Sets tab stops for this StringFormat object.

public void SetTabStops(float firstTabOffset, float[] tabStops)

Parameters

firstTabOffset float

The number of spaces between the beginning of a line of text and the first tab stop.

tabStops float[]

An array of distances between tab stops in the units specified by the PageUnit property.

ToString()

Converts this StringFormat object to a human-readable string.

public override string ToString()

Returns

string

A string representation of this StringFormat object.