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 and Description |
---|
StringFormat()
Initializes a new
StringFormat object. |
StringFormat(int options)
Initializes a new
StringFormat object with the specified StringFormatFlags enumeration and language. |
StringFormat(StringFormat format)
Initializes a new
StringFormat object from the specified existing StringFormat object. |
Modifier and Type | Method and Description |
---|---|
StringFormat |
deepClone()
Creates a deep clone of this
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
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 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
P:Aspose.PSD.Graphics.PageUnit property. |
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 |
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
HotkeyPrefix object for this 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
StringFormat object. |
void |
setTrimming(int value)
Gets or sets the
StringTrimming enumeration for this StringFormat object. |
String |
toString()
Converts this
StringFormat object to a human-readable string. |
dispose, getDisposed
public StringFormat()
Initializes a new StringFormat
object.
public StringFormat(int options)
Initializes a new StringFormat
object with the specified StringFormatFlags
enumeration and language.
options
- The StringFormatFlags
enumeration for the new StringFormat
object.public StringFormat(StringFormat format)
Initializes a new StringFormat
object from the specified existing StringFormat
object.
format
- The StringFormat
object from which to initialize the new StringFormat
object.com.aspose.ms.System.ArgumentNullException
- format
is null.public static StringFormat getGenericDefault()
Gets a generic default StringFormat
object.
StringFormat
object.public static StringFormat getGenericTypographic()
Gets a generic typographic StringFormat
object.
StringFormat
object.public final int getFormatFlags()
Gets or sets a StringFormatFlags
enumeration that contains formatting information.
StringFormatFlags
enumeration that contains formatting information.public final void setFormatFlags(int value)
Gets or sets a StringFormatFlags
enumeration that contains formatting information.
StringFormatFlags
enumeration that contains formatting information.public final int getAlignment()
Gets or sets text alignment information on the vertical plane.
Value: AStringAlignment
enumeration that specifies text alignment information.public final void setAlignment(int value)
Gets or sets text alignment information on the vertical plane.
Value: AStringAlignment
enumeration that specifies text alignment information.public final int getLineAlignment()
Gets or sets the line alignment on the horizontal plane.
Value: AStringAlignment
enumeration that represents the line alignment.public final void setLineAlignment(int value)
Gets or sets the line alignment on the horizontal plane.
Value: AStringAlignment
enumeration that represents the line alignment.public final int getHotkeyPrefix()
Gets or sets the HotkeyPrefix
object for this StringFormat
object.
HotkeyPrefix
object for this StringFormat
object, the default is F:Aspose.PSD.HotkeyPrefix.None
.public final void setHotkeyPrefix(int value)
Gets or sets the HotkeyPrefix
object for this StringFormat
object.
HotkeyPrefix
object for this StringFormat
object, the default is F:Aspose.PSD.HotkeyPrefix.None
.public final int getTrimming()
Gets or sets the StringTrimming
enumeration for this StringFormat
object.
StringTrimming
enumeration that indicates how text drawn with this StringFormat
object is trimmed when it exceeds the edges of the layout rectangle.public final void setTrimming(int value)
Gets or sets the StringTrimming
enumeration for this StringFormat
object.
StringTrimming
enumeration that indicates how text drawn with this StringFormat
object is trimmed when it exceeds the edges of the layout rectangle.public final int getDigitSubstitutionMethod()
Gets or sets the method to be used for digit substitution.
Value: AStringDigitSubstitute
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 final void setDigitSubstitutionMethod(int value)
Gets or sets the method to be used for digit substitution.
Value: AStringDigitSubstitute
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 final 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 theP: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 P:System.Globalization.CultureInfo.LCID
property of that Locale
object along with.
F:Aspose.PSD.StringDigitSubstitute.Traditional
to the M:Aspose.PSD.StringFormat.SetDigitSubstitution(System.Int32,Aspose.PSD.StringDigitSubstitute)
method,
then Arabic-Indic digits will be substituted for western digits at display time.public final 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 theP: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 P:System.Globalization.CultureInfo.LCID
property of that Locale
object along with.
F:Aspose.PSD.StringDigitSubstitute.Traditional
to the M:Aspose.PSD.StringFormat.SetDigitSubstitution(System.Int32,Aspose.PSD.StringDigitSubstitute)
method,
then Arabic-Indic digits will be substituted for western digits at display time.public final 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.public final float[] getTabStops()
Gets an array of distances between tab stops in the units specified by the P:Aspose.PSD.Graphics.PageUnit
property.
public final StringFormat deepClone()
Creates a deep clone of this StringFormat
object.
StringFormat
.public final 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 P:Aspose.PSD.Graphics.PageUnit
property.public String toString()
Converts this StringFormat
object to a human-readable string.
toString
in class Object
StringFormat
object.Copyright (c) 2008-2020 Aspose Pty Ltd. All Rights Reserved.