StringFormat
Inheritance: java.lang.Object
All Implemented Interfaces: com.aspose.ms.System.IDisposable
public final class StringFormat implements System.IDisposable
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
Constructor | Description |
---|---|
StringFormat() | Initializes a new instance of the StringFormat class. |
StringFormat(StringFormat format) | Initializes a new instance of the StringFormat class from the specified existing StringFormat object. |
StringFormat(int options, int language) | Initializes a new instance of the StringFormat class with the specified StringFormatFlags enumeration and language. |
StringFormat(int options) | Initializes a new instance of the StringFormat class with the specified StringFormatFlags enumeration. |
Methods
Method | Description |
---|---|
setDigitSubstitutionLanguage(int value) | |
setDigitSubstitutionMethod(int value) | |
getFirstTabOffset() | |
getGenericDefault() | Gets a generic default StringFormat object. |
getGenericTypographic() | Gets a generic typographic StringFormat object. |
getFormatFlags() | Gets or sets a StringFormatFlags enumeration that contains formatting information. |
setFormatFlags(int value) | Gets or sets a StringFormatFlags enumeration that contains formatting information. |
getAlignment() | Gets or sets text alignment information on the vertical plane. |
setAlignment(int value) | Gets or sets text alignment information on the vertical plane. |
getLineAlignment() | Gets or sets the line alignment on the horizontal plane. |
setLineAlignment(int value) | Gets or sets the line alignment on the horizontal plane. |
getHotkeyPrefix() | Gets or sets the HotkeyPrefix (.getHotkeyPrefix/.setHotkeyPrefix(int)) object for this StringFormat object. |
setHotkeyPrefix(int value) | Gets or sets the HotkeyPrefix (.getHotkeyPrefix/.setHotkeyPrefix(int)) object for this StringFormat object. |
getTrimming() | Gets or sets the StringTrimming enumeration for this StringFormat object. |
setTrimming(int value) | Gets or sets the StringTrimming enumeration for this StringFormat object. |
getDigitSubstitutionLanguage() | Gets the language that is used when local digits are substituted for western digits. |
getDigitSubstitutionMethod() | Gets the method to be used for digit substitution. |
dispose() | Releases all resources used by this StringFormat object. |
deepClone() | Creates an exact copy of this StringFormat object. |
getTabStops(float[] firstTabOffset) | Gets the tab stops for this StringFormat object. |
getTabStops() | Gets an array of distances between tab stops in the units specified by the Aspose.Imaging.getGraphics().PageUnit property. |
setTabStops(float firstTabOffset, float[] tabStops) | Sets tab stops for this StringFormat object. |
setDigitSubstitution(int language, int substitute) | Specifies the language and method to be used when local digits are substituted for western digits. |
setMeasurableCharacterRanges(CharacterRange[] ranges) | Specifies an array of CharacterRange structures that represent the ranges of characters measured by a call to the MeasureCharacterRanges method. |
StringFormat()
public StringFormat()
Initializes a new instance of the StringFormat class.
StringFormat(StringFormat format)
public StringFormat(StringFormat format)
Initializes a new instance of the StringFormat class from the specified existing StringFormat object.
Parameters:
Parameter | Type | Description |
---|---|---|
format | StringFormat | The StringFormat object from which to initialize the new StringFormat object. |
StringFormat(int options, int language)
public StringFormat(int options, int language)
Initializes a new instance of the StringFormat class with the specified StringFormatFlags enumeration and language.
Parameters:
Parameter | Type | Description |
---|---|---|
options | int | The StringFormatFlags enumeration for the new StringFormat object. |
language | int | A value that indicates the language of the text. |
StringFormat(int options)
public StringFormat(int options)
Initializes a new instance of the StringFormat class with the specified StringFormatFlags enumeration.
Parameters:
Parameter | Type | Description |
---|---|---|
options | int | The StringFormatFlags enumeration for the new StringFormat object. |
setDigitSubstitutionLanguage(int value)
public void setDigitSubstitutionLanguage(int value)
Parameters:
Parameter | Type | Description |
---|---|---|
value | int |
setDigitSubstitutionMethod(int value)
public void setDigitSubstitutionMethod(int value)
Parameters:
Parameter | Type | Description |
---|---|---|
value | int |
getFirstTabOffset()
public float getFirstTabOffset()
Returns: float
getGenericDefault()
public static StringFormat getGenericDefault()
Gets a generic default StringFormat object.
Returns: StringFormat
getGenericTypographic()
public static StringFormat getGenericTypographic()
Gets a generic typographic StringFormat object.
Returns: StringFormat - A generic typographic StringFormat object.
getFormatFlags()
public int getFormatFlags()
Gets or sets a StringFormatFlags enumeration that contains formatting information.
Returns: int
setFormatFlags(int value)
public void setFormatFlags(int value)
Gets or sets a StringFormatFlags enumeration that contains formatting information.
Parameters:
Parameter | Type | Description |
---|---|---|
value | int |
getAlignment()
public int getAlignment()
Gets or sets text alignment information on the vertical plane.
Returns: int
setAlignment(int value)
public void setAlignment(int value)
Gets or sets text alignment information on the vertical plane.
Parameters:
Parameter | Type | Description |
---|---|---|
value | int |
getLineAlignment()
public int getLineAlignment()
Gets or sets the line alignment on the horizontal plane.
Returns: int
setLineAlignment(int value)
public void setLineAlignment(int value)
Gets or sets the line alignment on the horizontal plane.
Parameters:
Parameter | Type | Description |
---|---|---|
value | int |
getHotkeyPrefix()
public int getHotkeyPrefix()
Gets or sets the HotkeyPrefix
(.getHotkeyPrefix/.setHotkeyPrefix(int)) object for this StringFormat object.
Returns: int
setHotkeyPrefix(int value)
public void setHotkeyPrefix(int value)
Gets or sets the HotkeyPrefix
(.getHotkeyPrefix/.setHotkeyPrefix(int)) object for this StringFormat object.
Parameters:
Parameter | Type | Description |
---|---|---|
value | int |
getTrimming()
public int getTrimming()
Gets or sets the StringTrimming enumeration for this StringFormat object.
Returns: int
setTrimming(int value)
public void setTrimming(int value)
Gets or sets the StringTrimming enumeration for this StringFormat object.
Parameters:
Parameter | Type | Description |
---|---|---|
value | int |
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 System.Globalization.CultureInfo.LCID
property of a java.util.Locale object as the NLS language identifier. For example, suppose you create a java.util.Locale object by passing the string “ar-EG” to a java.util.Locale constructor. If you pass the System.Globalization.CultureInfo.LCID
property of that java.util.Locale object along with.StringDigitSubstitute.Traditional
to the .setDigitSubstitution(int,int) method, then Arabic-Indic digits will be substituted for western digits at display time.
getDigitSubstitutionMethod()
public int getDigitSubstitutionMethod()
Gets the method to be used for digit substitution.
Returns: int - A 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.
dispose()
public void dispose()
Releases all resources used by this StringFormat object.
deepClone()
public StringFormat deepClone()
Creates an exact copy of this StringFormat object.
Returns: StringFormat - The StringFormat object this method creates.
getTabStops(float[] firstTabOffset)
public float[] getTabStops(float[] firstTabOffset)
Gets the tab stops for this StringFormat object.
Parameters:
Parameter | Type | Description |
---|---|---|
firstTabOffset | float[] | The number of spaces between the beginning of a text line and the first tab stop. |
Returns: float[] - An array of distances (in number of spaces) between tab stops.
getTabStops()
public float[] getTabStops()
Gets an array of distances between tab stops in the units specified by the Aspose.Imaging.getGraphics().PageUnit
property.
Returns: float[] - The tab stops.
The property is introduced for removed method GetTabStops.
setTabStops(float firstTabOffset, float[] tabStops)
public void setTabStops(float firstTabOffset, float[] tabStops)
Sets tab stops for this StringFormat object.
Parameters:
Parameter | Type | Description |
---|---|---|
firstTabOffset | float | The number of spaces between the beginning of a line of text and the first tab stop. |
tabStops | float[] | An array of distances between tab stops in the units specified by the Graphics.PageUnit property. |
setDigitSubstitution(int language, int substitute)
public void setDigitSubstitution(int language, int substitute)
Specifies the language and method to be used when local digits are substituted for western digits.
Parameters:
Parameter | Type | Description |
---|---|---|
language | 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 System.Globalization.CultureInfo.LCID property of a java.util.Locale object as the NLS language identifier. For example, suppose you create a java.util.Locale object by passing the string "ar-EG" to a java.util.Locale constructor. If you pass the System.Globalization.CultureInfo.LCID property of that java.util.Locale object along with StringDigitSubstitute.Traditional to the M:StringFormat.SetDigitSubstitution(System.Int32,StringDigitSubstitute) method, then Arabic-Indic digits will be substituted for western digits at display time. |
substitute | int | An element of the StringDigitSubstitute enumeration that specifies how digits are displayed. |
setMeasurableCharacterRanges(CharacterRange[] ranges)
public void setMeasurableCharacterRanges(CharacterRange[] ranges)
Specifies an array of CharacterRange structures that represent the ranges of characters measured by a call to the MeasureCharacterRanges
method.
Parameters:
Parameter | Type | Description |
---|---|---|
ranges | CharacterRange[] | An array of CharacterRange structures that specifies the ranges of characters measured by a call to the MeasureCharacterRanges method. |