Packages

 

com.aspose.cad

Class StringFormat

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


    public final class StringFormat
    extends com.aspose.cad.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.imagingStringFormat object.
      StringFormat(int options)
      Initializes a new com.aspose.imagingStringFormat object with the specified com.aspose.imagingStringFormatFlags enumeration and language.
      StringFormat(StringFormat format)
      Initializes a new com.aspose.imagingStringFormat object from the specified existing com.aspose.imagingStringFormat 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 com.aspose.imagingStringFormat 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 com.aspose.imagingStringFormatFlags enumeration that contains formatting information.
      static StringFormat getGenericDefault()
      Gets a generic default com.aspose.imagingStringFormat object.
      static StringFormat getGenericTypographic()
      Gets a generic typographic com.aspose.imagingStringFormat object.
      int getHotkeyPrefix()
      Gets or sets the com.aspose.imagingHotkeyPrefix object for this com.aspose.imagingStringFormat 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.CAD.Graphics.PageUnit property.
      int getTrimming()
      Gets or sets the com.aspose.imagingStringTrimming enumeration for this com.aspose.imagingStringFormat 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 StringFormatFlags enumeration that contains formatting information.
      void setHotkeyPrefix(int value)
      Gets or sets the com.aspose.imagingHotkeyPrefix object for this com.aspose.imagingStringFormat 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 com.aspose.imagingStringFormat object.
      void setTrimming(int value)
      Gets or sets the com.aspose.imagingStringTrimming enumeration for this com.aspose.imagingStringFormat object.
      String toString()
      Converts this com.aspose.imagingStringFormat object to a human-readable string.
      • Methods inherited from class com.aspose.cad.DisposableObject

        close, dispose, getDisposed
    • Constructor Detail

      • StringFormat

        public StringFormat()

        Initializes a new com.aspose.imagingStringFormat object.

      • StringFormat

        public StringFormat(int options)

        Initializes a new com.aspose.imagingStringFormat object with the specified com.aspose.imagingStringFormatFlags enumeration and language.

        Parameters:
        options - The com.aspose.imagingStringFormatFlags enumeration for the new com.aspose.imagingStringFormat object.
      • StringFormat

        public StringFormat(StringFormat format)

        Initializes a new com.aspose.imagingStringFormat object from the specified existing com.aspose.imagingStringFormat object.

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

      • getGenericDefault

        public static StringFormat getGenericDefault()

        Gets a generic default com.aspose.imagingStringFormat object.

        Returns:
        The generic default com.aspose.imagingStringFormat object.
      • getGenericTypographic

        public static StringFormat getGenericTypographic()

        Gets a generic typographic com.aspose.imagingStringFormat object.

        Returns:
        A generic typographic com.aspose.imagingStringFormat object.
      • getFormatFlags

        public int getFormatFlags()

        Gets or sets a com.aspose.imagingStringFormatFlags enumeration that contains formatting information.

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

        public void setFormatFlags(int value)

        Gets or sets a StringFormatFlags enumeration that contains formatting information.

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

        public int getAlignment()

        Gets or sets text alignment information on the vertical plane.

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

        public void setAlignment(int value)

        Gets or sets text alignment information on the vertical plane.

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

        public int getLineAlignment()

        Gets or sets the line alignment on the horizontal plane.

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

        public void setLineAlignment(int value)

        Gets or sets the line alignment on the horizontal plane.

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

        public int getHotkeyPrefix()

        Gets or sets the com.aspose.imagingHotkeyPrefix object for this com.aspose.imagingStringFormat object.

        Returns:
        The com.aspose.imagingHotkeyPrefix object for this com.aspose.imagingStringFormat object, the default is F:Aspose.CAD.HotkeyPrefix.None.
      • setHotkeyPrefix

        public void setHotkeyPrefix(int value)

        Gets or sets the com.aspose.imagingHotkeyPrefix object for this com.aspose.imagingStringFormat object.

        Parameters:
        value - The com.aspose.imagingHotkeyPrefix object for this com.aspose.imagingStringFormat object, the default is F:Aspose.CAD.HotkeyPrefix.None.
      • getTrimming

        public int getTrimming()

        Gets or sets the com.aspose.imagingStringTrimming enumeration for this com.aspose.imagingStringFormat object.

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

        public void setTrimming(int value)

        Gets or sets the com.aspose.imagingStringTrimming enumeration for this com.aspose.imagingStringFormat object.

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

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

        Parameters:
        value - A com.aspose.imagingStringDigitSubstitute 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.

        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 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.CAD.StringDigitSubstitute.Traditional to the M:Aspose.CAD.StringFormat.SetDigitSubstitution(System.Int32,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)

        Gets or 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 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.CAD.StringDigitSubstitute.Traditional to the M:Aspose.CAD.StringFormat.SetDigitSubstitution(System.Int32,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 P:Aspose.CAD.Graphics.PageUnit property.

        Returns:
        The tab stops.


        The property is introduced for removed method GetTabStops.

      • deepClone

        public StringFormat deepClone()

        Creates a deep clone of this com.aspose.imagingStringFormat object.

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

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

        Sets tab stops for this com.aspose.imagingStringFormat 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.CAD.Graphics.PageUnit property.
      • toString

        public String toString()

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

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

Copyright (c) 2008-2019 Aspose Pty Ltd. All Rights Reserved.