com.aspose.imaging
Class StringFormat

java.lang.Object
  extended by com.aspose.imaging.DisposableObject
      extended by com.aspose.imaging.StringFormat

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.


Constructor Summary
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.
 
Method Summary
 StringFormat deepClone()
           Creates a deep clone of this com.aspose.imaging.StringFormat object.
 int getAlignment()
           Gets text alignment information on the vertical plane.
 int getDigitSubstitutionLanguage()
           Gets the language that is used when local digits are substituted for western digits.
 int getDigitSubstitutionMethod()
           Gets the method to be used for digit substitution.
 float getFirstTabOffset()
           Gets the number of spaces between the beginning of a line of text and the first tab stop.
 int getFormatFlags()
           Gets a com.aspose.imaging.StringFormatFlags enumeration that contains formatting information.
static StringFormat getGenericDefault()
           Gets a generic default com.aspose.imaging.StringFormat object.
static StringFormat getGenericTypographic()
           Gets a generic typographic com.aspose.imaging.StringFormat object.
 int getHotkeyPrefix()
           Gets the com.aspose.imaging.HotkeyPrefix object for this com.aspose.imaging.StringFormat object.
 int getLineAlignment()
           Gets the line alignment on the horizontal plane.
 float[] getTabStops()
           Gets an array of distances between tab stops in the units specified by the Graphics.PageUnit property.
 int getTrimming()
           Gets the com.aspose.imaging.StringTrimming enumeration for this com.aspose.imaging.StringFormat object.
 void setAlignment(int value)
           Sets text alignment information on the vertical plane.
 void setDigitSubstitutionLanguage(int value)
           Sets the language that is used when local digits are substituted for western digits.
 void setDigitSubstitutionMethod(int value)
           Sets the method to be used for digit substitution.
 void setFormatFlags(int value)
           Sets a com.aspose.imaging.StringFormatFlags enumeration that contains formatting information.
 void setHotkeyPrefix(int value)
           Sets the com.aspose.imaging.HotkeyPrefix object for this com.aspose.imaging.StringFormat object.
 void setLineAlignment(int value)
           Sets the line alignment on the horizontal plane.
 void setTabStops(float firstTabOffset, float[] tabStops)
           Sets tab stops for this com.aspose.imaging.StringFormat object.
 void setTrimming(int value)
           Sets the com.aspose.imaging.StringTrimming enumeration for this com.aspose.imaging.StringFormat object.
 java.lang.String toString()
           Converts this com.aspose.imaging.StringFormat object to a human-readable string.
 
Methods inherited from class com.aspose.imaging.DisposableObject
dispose, getDisposed, releaseManagedResources, releaseUnmanagedResources, verifyNotDisposed
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

StringFormat

public StringFormat()

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


StringFormat

public StringFormat(int options)

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

Parameters:
options - The com.aspose.imaging.StringFormatFlags enumeration for the new com.aspose.imaging.StringFormat object.

StringFormat

public StringFormat(StringFormat format)

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

Method Detail

deepClone

public StringFormat deepClone()

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

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

getAlignment

public int getAlignment()

Gets text alignment information on the vertical plane.

Value: A com.aspose.imaging.StringAlignment enumeration that specifies text alignment information.


getDigitSubstitutionLanguage

public int getDigitSubstitutionLanguage()

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

Value: 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 System.Globalization.CultureInfo.LCID property of a System.Globalization.CultureInfo object as the NLS language identifier. For example, suppose you create a System.Globalization.CultureInfo object by passing the string "ar-EG" to a System.Globalization.CultureInfo constructor. If you pass the System.Globalization.CultureInfo.LCID property of that System.Globalization.CultureInfo object along with. com.aspose.imaging.StringDigitSubstitute.Traditional to the StringFormat.SetDigitSubstitution(System.Int32,StringDigitSubstitute) method, then Arabic-Indic digits will be substituted for western digits at display time.


The setter is introduced for the obsolete method SetDigitSubstitution.


getDigitSubstitutionMethod

public int getDigitSubstitutionMethod()

Gets the method to be used for digit substitution.

Value: 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.


getFirstTabOffset

public float getFirstTabOffset()

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

Value: The first tab offset.


The property is introduced for removed method GetTabStops.


getFormatFlags

public int getFormatFlags()

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

Value: A com.aspose.imaging.StringFormatFlags enumeration that contains formatting information.


getGenericDefault

public static StringFormat getGenericDefault()

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

Value: The generic default com.aspose.imaging.StringFormat object.


getGenericTypographic

public static StringFormat getGenericTypographic()

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

Value: A generic typographic com.aspose.imaging.StringFormat object.


getHotkeyPrefix

public int getHotkeyPrefix()

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

Value: The com.aspose.imaging.HotkeyPrefix object for this com.aspose.imaging.StringFormat object, the default is com.aspose.imaging.HotkeyPrefix.None.


getLineAlignment

public int getLineAlignment()

Gets the line alignment on the horizontal plane.

Value: A com.aspose.imaging.StringAlignment enumeration that represents the line alignment.


getTabStops

public float[] getTabStops()

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

Value: The tab stops.


The property is introduced for removed method GetTabStops.


getTrimming

public int getTrimming()

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

Value: 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.


setAlignment

public void setAlignment(int value)

Sets text alignment information on the vertical plane.

Value: A com.aspose.imaging.StringAlignment enumeration that specifies text alignment information.


setDigitSubstitutionLanguage

public void setDigitSubstitutionLanguage(int value)

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

Value: 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 System.Globalization.CultureInfo.LCID property of a System.Globalization.CultureInfo object as the NLS language identifier. For example, suppose you create a System.Globalization.CultureInfo object by passing the string "ar-EG" to a System.Globalization.CultureInfo constructor. If you pass the System.Globalization.CultureInfo.LCID property of that System.Globalization.CultureInfo object along with. com.aspose.imaging.StringDigitSubstitute.Traditional to the StringFormat.SetDigitSubstitution(System.Int32,StringDigitSubstitute) method, then Arabic-Indic digits will be substituted for western digits at display time.


The setter is introduced for the obsolete method SetDigitSubstitution.


setDigitSubstitutionMethod

public void setDigitSubstitutionMethod(int value)

Sets the method to be used for digit substitution.

Value: 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.


setFormatFlags

public void setFormatFlags(int value)

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

Value: A com.aspose.imaging.StringFormatFlags enumeration that contains formatting information.


setHotkeyPrefix

public void setHotkeyPrefix(int value)

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

Value: The com.aspose.imaging.HotkeyPrefix object for this com.aspose.imaging.StringFormat object, the default is com.aspose.imaging.HotkeyPrefix.None.


setLineAlignment

public void setLineAlignment(int value)

Sets the line alignment on the horizontal plane.

Value: A com.aspose.imaging.StringAlignment enumeration that represents the line alignment.


setTabStops

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

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

Parameters:
firstTabOffset - The number of spaces between the beginning of a line of text and the first tab stop.
tabStops - An array of distances between tab stops in the units specified by the Graphics.PageUnit property.

setTrimming

public void setTrimming(int value)

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

Value: 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.


toString

public java.lang.String toString()

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

Overrides:
toString in class java.lang.Object
Returns:
A string representation of this com.aspose.imaging.StringFormat object.