Packages

 

com.aspose.cad

Class StringFormat

  • All Implemented Interfaces:
    com.aspose.ms.System.IDisposable, Closeable, AutoCloseable


    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

      Constructors 
      Constructor and Description
      StringFormat()
      Initializes a new T:Aspose.Imaging.StringFormat object.
      StringFormat(int options)
      Initializes a new T:Aspose.Imaging.StringFormat object with the specified T:Aspose.Imaging.StringFormatFlags enumeration and language.
      StringFormat(StringFormat format)
      Initializes a new T:Aspose.Imaging.StringFormat object from the specified existing T:Aspose.Imaging.StringFormat object.
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method and Description
      StringFormat deepClone()
      Creates a deep clone of this T:Aspose.Imaging.StringFormat object.
      int getAlignment()
      Gets or sets text alignment information on the vertical plane.
      int getDigitSubstitutionLanguage()
      Gets or sets the language that is used when local digits are substituted for western digits.
      int getDigitSubstitutionMethod()
      Gets or sets 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 or sets a T:Aspose.Imaging.StringFormatFlags enumeration that contains formatting information.
      static StringFormat getGenericDefault()
      Gets a generic default T:Aspose.Imaging.StringFormat object.
      static StringFormat getGenericTypographic()
      Gets a generic typographic T:Aspose.Imaging.StringFormat object.
      int getHotkeyPrefix()
      Gets or sets the T:Aspose.Imaging.HotkeyPrefix object for this T:Aspose.Imaging.StringFormat object.
      int getLineAlignment()
      Gets or sets the line alignment on the horizontal plane.
      float[] getTabStops()
      Gets an array of distances between tab stops in the units specified by the P:Aspose.Imaging.getGraphics().PageUnit property.
      int getTrimming()
      Gets or sets the T:Aspose.Imaging.StringTrimming enumeration for this T:Aspose.Imaging.StringFormat object.
      void setAlignment(int value)
      Gets or sets text alignment information on the vertical plane.
      void setDigitSubstitutionLanguage(int value)
      Gets or sets the language that is used when local digits are substituted for western digits.
      void setDigitSubstitutionMethod(int value)
      Gets or sets the method to be used for digit substitution.
      void setFormatFlags(int value)
      Gets or sets a T:Aspose.Imaging.StringFormatFlags enumeration that contains formatting information.
      void setHotkeyPrefix(int value)
      Gets or sets the T:Aspose.Imaging.HotkeyPrefix object for this T:Aspose.Imaging.StringFormat object.
      void setLineAlignment(int value)
      Gets or sets the line alignment on the horizontal plane.
      void setTabStops(float firstTabOffset, float[] tabStops)
      Sets tab stops for this T:Aspose.Imaging.StringFormat object.
      void setTrimming(int value)
      Gets or sets the T:Aspose.Imaging.StringTrimming enumeration for this T:Aspose.Imaging.StringFormat object.
      String toString()
      Converts this T:Aspose.Imaging.StringFormat object to a human-readable string.
    • Constructor Detail

      • StringFormat

        public StringFormat()

        Initializes a new T:Aspose.Imaging.StringFormat object.

      • StringFormat

        public StringFormat(int options)

        Initializes a new T:Aspose.Imaging.StringFormat object with the specified T:Aspose.Imaging.StringFormatFlags enumeration and language.

        Parameters:
        options - The T:Aspose.Imaging.StringFormatFlags enumeration for the new T:Aspose.Imaging.StringFormat object.
      • StringFormat

        public StringFormat(StringFormat format)

        Initializes a new T:Aspose.Imaging.StringFormat object from the specified existing T:Aspose.Imaging.StringFormat object.

        Parameters:
        format - The T:Aspose.Imaging.StringFormat object from which to initialize the new T:Aspose.Imaging.StringFormat object.
        Throws:
        com.aspose.ms.System.ArgumentNullException - format is null.
    • Method Detail

      • getGenericDefault

        public static StringFormat getGenericDefault()

        Gets a generic default T:Aspose.Imaging.StringFormat object.

        Value: The generic default T:Aspose.Imaging.StringFormat object.
      • getGenericTypographic

        public static StringFormat getGenericTypographic()

        Gets a generic typographic T:Aspose.Imaging.StringFormat object.

        Value: A generic typographic T:Aspose.Imaging.StringFormat object.
      • getFormatFlags

        public int getFormatFlags()

        Gets or sets a T:Aspose.Imaging.StringFormatFlags enumeration that contains formatting information.

        Value: A T:Aspose.Imaging.StringFormatFlags enumeration that contains formatting information.
      • setFormatFlags

        public void setFormatFlags(int value)

        Gets or sets a T:Aspose.Imaging.StringFormatFlags enumeration that contains formatting information.

        Value: A T:Aspose.Imaging.StringFormatFlags enumeration that contains formatting information.
      • getAlignment

        public int getAlignment()

        Gets or sets text alignment information on the vertical plane.

        Value: A T:Aspose.Imaging.StringAlignment enumeration that specifies text alignment information.
      • setAlignment

        public void setAlignment(int value)

        Gets or sets text alignment information on the vertical plane.

        Value: A T:Aspose.Imaging.StringAlignment enumeration that specifies text alignment information.
      • getLineAlignment

        public int getLineAlignment()

        Gets or sets the line alignment on the horizontal plane.

        Value: A T:Aspose.Imaging.StringAlignment enumeration that represents the line alignment.
      • setLineAlignment

        public void setLineAlignment(int value)

        Gets or sets the line alignment on the horizontal plane.

        Value: A T:Aspose.Imaging.StringAlignment enumeration that represents the line alignment.
      • getHotkeyPrefix

        public int getHotkeyPrefix()

        Gets or sets the T:Aspose.Imaging.HotkeyPrefix object for this T:Aspose.Imaging.StringFormat object.

        Value: The T:Aspose.Imaging.HotkeyPrefix object for this T:Aspose.Imaging.StringFormat object, the default is F:Aspose.Imaging.HotkeyPrefix.None.
      • setHotkeyPrefix

        public void setHotkeyPrefix(int value)

        Gets or sets the T:Aspose.Imaging.HotkeyPrefix object for this T:Aspose.Imaging.StringFormat object.

        Value: The T:Aspose.Imaging.HotkeyPrefix object for this T:Aspose.Imaging.StringFormat object, the default is F:Aspose.Imaging.HotkeyPrefix.None.
      • getTrimming

        public int getTrimming()

        Gets or sets the T:Aspose.Imaging.StringTrimming enumeration for this T:Aspose.Imaging.StringFormat object.

        Value: A T:Aspose.Imaging.StringTrimming enumeration that indicates how text drawn with this T:Aspose.Imaging.StringFormat object is trimmed when it exceeds the edges of the layout rectangle.
      • setTrimming

        public void setTrimming(int value)

        Gets or sets the T:Aspose.Imaging.StringTrimming enumeration for this T:Aspose.Imaging.StringFormat object.

        Value: A T:Aspose.Imaging.StringTrimming enumeration that indicates how text drawn with this T:Aspose.Imaging.StringFormat object is trimmed when it exceeds the edges of the layout rectangle.
      • getDigitSubstitutionMethod

        public int getDigitSubstitutionMethod()

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

        Value: A T: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

        public void setDigitSubstitutionMethod(int value)

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

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

        The setter is introduced for the obsolete method SetDigitSubstitution.

      • setDigitSubstitutionLanguage

        public void setDigitSubstitutionLanguage(int value)

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

        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.

      • getTabStops

        public float[] getTabStops()

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

        Value: The tab stops.

        The property is introduced for removed method GetTabStops.

      • deepClone

        public StringFormat deepClone()

        Creates a deep clone of this T:Aspose.Imaging.StringFormat object.

        Returns:
        The deep clone of the current T:Aspose.Imaging.StringFormat.
      • setTabStops

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

        Sets tab stops for this T: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 P:Aspose.Imaging.getGraphics().PageUnit property.
      • toString

        public String toString()

        Converts this T:Aspose.Imaging.StringFormat object to a human-readable string.

        Overrides:
        toString in class Object
        Returns:
        A string representation of this T:Aspose.Imaging.StringFormat object.