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 com.aspose.cad.StringFormat object.
      StringFormat(int options)
      Initializes a new com.aspose.cad.StringFormat object with the specified com.aspose.cad.StringFormatFlags enumeration and language.
      StringFormat(StringFormat format)
      Initializes a new com.aspose.cad.StringFormat object from the specified existing com.aspose.cad.StringFormat object.
    • Constructor Detail

      • StringFormat

        public StringFormat()

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

      • StringFormat

        public StringFormat(int options)

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

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

        public StringFormat(StringFormat format)

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

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

      • getGenericDefault

        public static StringFormat getGenericDefault()

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

        Returns:
        The generic default com.aspose.cad.StringFormat object.
      • getGenericTypographic

        public static StringFormat getGenericTypographic()

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

        Returns:
        A generic typographic com.aspose.cad.StringFormat object.
      • getFormatFlags

        public int getFormatFlags()

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

        Returns:
        A com.aspose.cad.StringFormatFlags enumeration that contains formatting information.
      • setFormatFlags

        public void setFormatFlags(int value)

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

        Parameters:
        value - A com.aspose.cad.StringFormatFlags enumeration that contains formatting information.
      • getAlignment

        public int getAlignment()

        Gets text alignment information on the vertical plane.

        Returns:
        A com.aspose.cad.StringAlignment enumeration that specifies text alignment information.
      • setAlignment

        public void setAlignment(int value)

        Sets text alignment information on the vertical plane.

        Parameters:
        value - A com.aspose.cad.StringAlignment enumeration that specifies text alignment information.
      • getLineAlignment

        public int getLineAlignment()

        Gets the line alignment on the horizontal plane.

        Returns:
        A com.aspose.cad.StringAlignment enumeration that represents the line alignment.
      • setLineAlignment

        public void setLineAlignment(int value)

        Sets the line alignment on the horizontal plane.

        Parameters:
        value - A com.aspose.cad.StringAlignment enumeration that represents the line alignment.
      • getHotkeyPrefix

        public int getHotkeyPrefix()

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

        Returns:
        The com.aspose.cad.HotkeyPrefix object for this com.aspose.cad.StringFormat object, the default is com.aspose.cad.HotkeyPrefix.None.
      • setHotkeyPrefix

        public void setHotkeyPrefix(int value)

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

        Parameters:
        value - The com.aspose.cad.HotkeyPrefix object for this com.aspose.cad.StringFormat object, the default is com.aspose.cad.HotkeyPrefix.None.
      • getTrimming

        public int getTrimming()

        Gets the com.aspose.cad.StringTrimming enumeration value for this com.aspose.cad.StringFormat object.

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

        public void setTrimming(int value)

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

        Parameters:
        value - A com.aspose.cad.StringTrimming enumeration that indicates how text drawn with this com.aspose.cad.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:
        A com.aspose.cad.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)

        Sets the method to be used for digit substitution.

        Parameters:
        value - A com.aspose.cad.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:
        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 com.aspose.ms.System.Globalization.CultureInfo.LCID property of a com.aspose.ms.System.Globalization.CultureInfo object as the NLS language identifier. For example, suppose you create a com.aspose.ms.System.Globalization.CultureInfo object by passing the string "ar-EG" to a com.aspose.ms.System.Globalization.CultureInfo constructor. If you pass the com.aspose.ms.System.Globalization.CultureInfo.LCID property of that com.aspose.ms.System.Globalization.CultureInfo object along with. com.aspose.cad.StringDigitSubstitute.Traditional to the com.aspose.cad.StringFormat.setDigitSubstitution(int, com.aspose.cad.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)

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

        Parameters:
        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 com.aspose.ms.System.Globalization.CultureInfo.LCID property of a com.aspose.ms.System.Globalization.CultureInfo object as the NLS language identifier. For example, suppose you create a com.aspose.ms.System.Globalization.CultureInfo object by passing the string "ar-EG" to a com.aspose.ms.System.Globalization.CultureInfo constructor. If you pass the com.aspose.ms.System.Globalization.CultureInfo.LCID property of that com.aspose.ms.System.Globalization.CultureInfo object along with. F:com.aspose.imaging.StringDigitSubstitute.Traditional to the M:com.aspose.imaging.StringFormat.setDigitSubstitution(int, com.aspose.cad.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.

        Returns:
        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 method getPageUnit of instance of Graphics object.

        Returns:
        The tab stops.

        The property is introduced for removed method GetTabStops.

      • deepClone

        public StringFormat deepClone()

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

        Returns:
        The deep clone of the current com.aspose.cad.StringFormat.
      • setTabStops

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

        Sets tab stops for this com.aspose.cad.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 method getPageUnit() of instance of Graphics object.
      • toString

        public String toString()

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

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