Class StringFormat
Namespace: Aspose.Imaging
Assembly: Aspose.Imaging.dll (25.4.0)
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
object ← DisposableObject ← StringFormat
Implements
Inherited Members
DisposableObject.Dispose(), DisposableObject.Disposed, object.GetType(), object.ToString(), object.Equals(object?), object.Equals(object?, object?), object.ReferenceEquals(object?, object?), object.GetHashCode()
Constructors
StringFormat()
Initializes a new Aspose.Imaging.StringFormat object.
public StringFormat()
StringFormat(StringFormatFlags)
Initializes a new Aspose.Imaging.StringFormat object with the specified Aspose.Imaging.StringFormatFlags enumeration and language.
public StringFormat(StringFormatFlags options)
Parameters
options
StringFormatFlags
The Aspose.Imaging.StringFormatFlags enumeration for the new Aspose.Imaging.StringFormat object.
StringFormat(StringFormat)
Initializes a new Aspose.Imaging.StringFormat object from the specified existing Aspose.Imaging.StringFormat object.
public StringFormat(StringFormat format)
Parameters
format
StringFormat
The Aspose.Imaging.StringFormat object from which to initialize the new Aspose.Imaging.StringFormat object.
Exceptions
format
is null.
Properties
Alignment
Gets or sets text alignment information on the vertical plane.
public StringAlignment Alignment { get; set; }
Property Value
CustomCharIdent
Gets or sets the custom character ident.
public PointF CustomCharIdent { get; set; }
Property Value
DigitSubstitutionLanguage
Gets or sets the language that is used when local digits are substituted for western digits.
public int DigitSubstitutionLanguage { get; set; }
Property Value
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
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
Remarks
The property is introduced for removed method GetTabStops.
FormatFlags
Gets or sets a Aspose.Imaging.StringFormatFlags enumeration that contains formatting information.
public StringFormatFlags FormatFlags { get; set; }
Property Value
GenericDefault
Gets a generic default Aspose.Imaging.StringFormat object.
public static StringFormat GenericDefault { get; }
Property Value
GenericTypographic
Gets a generic typographic Aspose.Imaging.StringFormat object.
public static StringFormat GenericTypographic { get; }
Property Value
HotkeyPrefix
Gets or sets the Aspose.Imaging.HotkeyPrefix object for this Aspose.Imaging.StringFormat object.
public HotkeyPrefix HotkeyPrefix { get; set; }
Property Value
LineAlignment
Gets or sets the line alignment on the horizontal plane.
public StringAlignment LineAlignment { get; set; }
Property Value
TabStops
Gets an array of distances between tab stops in the units specified by the Aspose.Imaging.Graphics.PageUnit property.
public float[] TabStops { get; }
Property Value
float[]
Remarks
The property is introduced for removed method GetTabStops.
Trimming
Gets or sets the Aspose.Imaging.StringTrimming enumeration for this Aspose.Imaging.StringFormat object.
public StringTrimming Trimming { get; set; }
Property Value
Methods
DeepClone()
Creates a deep clone of this Aspose.Imaging.StringFormat object.
public StringFormat DeepClone()
Returns
The deep clone of the current Aspose.Imaging.StringFormat.
Equals(object)
Check if objects are equal.
public override bool Equals(object obj)
Parameters
obj
object
The other object.
Returns
The equality comparison result.
GetHashCode()
Get hash code of the current object.
public override int GetHashCode()
Returns
The hash code.
SetTabStops(float, float[])
Sets tab stops for this Aspose.Imaging.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 Aspose.Imaging.Graphics.PageUnit property.
ToString()
Converts this Aspose.Imaging.StringFormat object to a human-readable string.
public override string ToString()
Returns
A string representation of this Aspose.Imaging.StringFormat object.