StringFormat

Inheritance: java.lang.Object, com.aspose.imaging.DisposableObject

public final class StringFormat extends DisposableObject

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.

Constructors

ConstructorDescription
StringFormat()Initializes a new com.aspose.imaging.StringFormat object.
StringFormat(int options)Initializes a new com.aspose.imaging.StringFormat object with the specified com.aspose.imaging.StringFormatFlags enumeration and language.
StringFormat(StringFormat format)Initializes a new com.aspose.imaging.StringFormat object from the specified existing com.aspose.imaging.StringFormat object.

Methods

MethodDescription
getGenericDefault()Gets a generic default com.aspose.imaging.StringFormat object.
getGenericTypographic()Gets a generic typographic com.aspose.imaging.StringFormat object.
getFormatFlags()Gets a com.aspose.imaging.StringFormatFlags enumeration that contains formatting information.
setFormatFlags(int value)Sets a com.aspose.imaging.StringFormatFlags enumeration that contains formatting information.
getAlignment()Gets text alignment information on the vertical plane.
setAlignment(int value)Sets text alignment information on the vertical plane.
getLineAlignment()Gets the line alignment on the horizontal plane.
setLineAlignment(int value)Sets the line alignment on the horizontal plane.
getHotkeyPrefix()Gets the com.aspose.imaging.HotkeyPrefix object for this com.aspose.imaging.StringFormat object.
setHotkeyPrefix(int value)Sets the com.aspose.imaging.HotkeyPrefix object for this com.aspose.imaging.StringFormat object.
getTrimming()Gets the com.aspose.imaging.StringTrimming enumeration for this com.aspose.imaging.StringFormat object.
setTrimming(int value)Sets the com.aspose.imaging.StringTrimming enumeration for this com.aspose.imaging.StringFormat object.
getDigitSubstitutionMethod()Gets the method to be used for digit substitution.
setDigitSubstitutionMethod(int value)Sets the method to be used for digit substitution.
getDigitSubstitutionLanguage()Gets the language that is used when local digits are substituted for western digits.
setDigitSubstitutionLanguage(int value)Sets the language that is used when local digits are substituted for western digits.
getFirstTabOffset()Gets the number of spaces between the beginning of a line of text and the first tab stop.
getTabStops()Gets an array of distances between tab stops in the units specified by the P:Aspose.Imaging.getGraphics().PageUnit property.
getCustomCharIdent()Gets the custom character ident.
setCustomCharIdent(PointF value)Sets the custom character ident.
deepClone()Creates a deep clone of this com.aspose.imaging.StringFormat object.
setTabStops(float firstTabOffset, float[] tabStops)Sets tab stops for this com.aspose.imaging.StringFormat object.
toString()Converts this com.aspose.imaging.StringFormat object to a human-readable string.
equals(Object o)Check if objects are equal.
hashCode()Get hash code of the current object.

StringFormat()

public StringFormat()

Initializes a new com.aspose.imaging.StringFormat object.

StringFormat(int options)

public StringFormat(int options)

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

Parameters:

ParameterTypeDescription
optionsintThe com.aspose.imaging.StringFormatFlags enumeration for the new com.aspose.imaging.StringFormat object.

StringFormat(StringFormat format)

public StringFormat(StringFormat format)

Initializes a new com.aspose.imaging.StringFormat object from the specified existing com.aspose.imaging.StringFormat object.

Parameters:

ParameterTypeDescription
formatStringFormatThe com.aspose.imaging.StringFormat object from which to initialize the new com.aspose.imaging.StringFormat object.

getGenericDefault()

public static StringFormat getGenericDefault()

Gets a generic default com.aspose.imaging.StringFormat object.

Returns: StringFormat - The generic default com.aspose.imaging.StringFormat object.

getGenericTypographic()

public static StringFormat getGenericTypographic()

Gets a generic typographic com.aspose.imaging.StringFormat object.

Returns: StringFormat - A generic typographic com.aspose.imaging.StringFormat object.

getFormatFlags()

public int getFormatFlags()

Gets a com.aspose.imaging.StringFormatFlags enumeration that contains formatting information.

Returns: int - A com.aspose.imaging.StringFormatFlags enumeration that contains formatting information.

setFormatFlags(int value)

public void setFormatFlags(int value)

Sets a com.aspose.imaging.StringFormatFlags enumeration that contains formatting information.

Parameters:

ParameterTypeDescription
valueintA com.aspose.imaging.StringFormatFlags enumeration that contains formatting information.

getAlignment()

public int getAlignment()

Gets text alignment information on the vertical plane.

Returns: int - A com.aspose.imaging.StringAlignment enumeration that specifies text alignment information.

setAlignment(int value)

public void setAlignment(int value)

Sets text alignment information on the vertical plane.

Parameters:

ParameterTypeDescription
valueintA com.aspose.imaging.StringAlignment enumeration that specifies text alignment information.

getLineAlignment()

public int getLineAlignment()

Gets the line alignment on the horizontal plane.

Returns: int - A com.aspose.imaging.StringAlignment enumeration that represents the line alignment.

setLineAlignment(int value)

public void setLineAlignment(int value)

Sets the line alignment on the horizontal plane.

Parameters:

ParameterTypeDescription
valueintA com.aspose.imaging.StringAlignment enumeration that represents the line alignment.

getHotkeyPrefix()

public int getHotkeyPrefix()

Gets the com.aspose.imaging.HotkeyPrefix object for this com.aspose.imaging.StringFormat object.

Returns: int - The com.aspose.imaging.HotkeyPrefix object for this com.aspose.imaging.StringFormat object, the default is F:Aspose.Imaging.HotkeyPrefix.None.

setHotkeyPrefix(int value)

public void setHotkeyPrefix(int value)

Sets the com.aspose.imaging.HotkeyPrefix object for this com.aspose.imaging.StringFormat object.

Parameters:

ParameterTypeDescription
valueintThe com.aspose.imaging.HotkeyPrefix object for this com.aspose.imaging.StringFormat object, the default is F:Aspose.Imaging.HotkeyPrefix.None.

getTrimming()

public int getTrimming()

Gets the com.aspose.imaging.StringTrimming enumeration for this com.aspose.imaging.StringFormat object.

Returns: int - A com.aspose.imaging.StringTrimming enumeration that indicates how text drawn with this com.aspose.imaging.StringFormat object is trimmed when it exceeds the edges of the layout rectangle.

setTrimming(int value)

public void setTrimming(int value)

Sets the com.aspose.imaging.StringTrimming enumeration for this com.aspose.imaging.StringFormat object.

Parameters:

ParameterTypeDescription
valueintA com.aspose.imaging.StringTrimming enumeration that indicates how text drawn with this com.aspose.imaging.StringFormat object is trimmed when it exceeds the edges of the layout rectangle.

getDigitSubstitutionMethod()

public int getDigitSubstitutionMethod()

Gets the method to be used for digit substitution.

Returns: int - A com.aspose.imaging.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.

The setter is introduced for the obsolete method SetDigitSubstitution.

setDigitSubstitutionMethod(int value)

public void setDigitSubstitutionMethod(int value)

Sets the method to be used for digit substitution.

Parameters:

ParameterTypeDescription
valueintA com.aspose.imaging.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.

The setter is introduced for the obsolete method SetDigitSubstitution. |

getDigitSubstitutionLanguage()

public int getDigitSubstitutionLanguage()

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

Returns: 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 P:System.Globalization.CultureInfo.LCID property of a System.Globalization.CultureInfo object as the NLS language identifier. For example, suppose you create and set a locale “ar-EG”. If you pass the com.aspose.imaging.StringDigitSubstitute.Traditional to the com.aspose.imaging.StringFormat.setDigitSubstitution(int) method, then Arabic-Indic digits will be substituted for western digits at display time.

setDigitSubstitutionLanguage(int value)

public void setDigitSubstitutionLanguage(int value)

Sets the language that is used when local digits are substituted for western digits.

Parameters:

ParameterTypeDescription
valueintA 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 P:System.Globalization.CultureInfo.LCID property of a System.Globalization.CultureInfo object as the NLS language identifier. For example, suppose you create and set a locale “ar-EG”. If you pass the com.aspose.imaging.StringDigitSubstitute.Traditional to the com.aspose.imaging.StringFormat.setDigitSubstitution(int) method, then Arabic-Indic digits will be substituted for western digits at display time.

getFirstTabOffset()

public float getFirstTabOffset()

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

Returns: float - The first tab offset.

The property is introduced for removed method GetTabStops.

getTabStops()

public float[] getTabStops()

Gets an array of distances between tab stops in the units specified by the P:Aspose.Imaging.getGraphics().PageUnit property.

Returns: float[] - The tab stops.

The property is introduced for removed method GetTabStops.

getCustomCharIdent()

public PointF getCustomCharIdent()

Gets the custom character ident.

Value: The custom character ident.

Returns: PointF - the custom character ident.

setCustomCharIdent(PointF value)

public void setCustomCharIdent(PointF value)

Sets the custom character ident.

Value: The custom character ident.

Parameters:

ParameterTypeDescription
valuePointFthe custom character ident.

deepClone()

public StringFormat deepClone()

Creates a deep clone of this com.aspose.imaging.StringFormat object.

Returns: StringFormat - The deep clone of the current com.aspose.imaging.StringFormat.

setTabStops(float firstTabOffset, float[] tabStops)

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

Sets tab stops for this com.aspose.imaging.StringFormat object.

Parameters:

ParameterTypeDescription
firstTabOffsetfloatThe number of spaces between the beginning of a line of text and the first tab stop.
tabStopsfloat[]An array of distances between tab stops in the units specified by the com.aspose.imaging.Graphics.PageUnit property.

toString()

public String toString()

Converts this com.aspose.imaging.StringFormat object to a human-readable string.

Returns: java.lang.String - A string representation of this com.aspose.imaging.StringFormat object.

equals(Object o)

public boolean equals(Object o)

Check if objects are equal.

Parameters:

ParameterTypeDescription
ojava.lang.ObjectThe other object.

Returns: boolean - The equality comparison result.

hashCode()

public int hashCode()

Get hash code of the current object.

Returns: int - The hash code.