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