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
com.aspose.imaging.StringFormat object. |
StringFormat(int options)
Initializes a new
com.aspose.imaging.StringFormat object with the specified com.aspose.imaging.StringFormatFlags enumeration and language. |
StringFormat(StringFormat format)
Initializes a new
com.aspose.imaging.StringFormat object from the specified existing com.aspose.imaging.StringFormat object. |
| Modifier and Type | Method and Description |
|---|---|
StringFormat |
deepClone()
Creates a deep clone of this
com.aspose.imaging.StringFormat object. |
int |
getAlignment()
Gets text alignment information on the vertical plane.
|
PointF |
getCustomCharIdent()
Gets the custom character ident.
|
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()
Gets the number of spaces between the beginning of a line of text and the first tab stop.
|
int |
getFormatFlags()
Gets a
com.aspose.imaging.StringFormatFlags enumeration that contains formatting information. |
static StringFormat |
getGenericDefault()
Gets a generic default
com.aspose.imaging.StringFormat object. |
static StringFormat |
getGenericTypographic()
Gets a generic typographic
com.aspose.imaging.StringFormat object. |
int |
getHotkeyPrefix()
Gets the
com.aspose.imaging.HotkeyPrefix object for this com.aspose.imaging.StringFormat object. |
int |
getLineAlignment()
Gets 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.Imaging.getGraphics().PageUnit property. |
int |
getTrimming()
Gets the
com.aspose.imaging.StringTrimming enumeration for this com.aspose.imaging.StringFormat object. |
void |
setAlignment(int value)
Sets text alignment information on the vertical plane.
|
void |
setCustomCharIdent(PointF value)
Sets the custom character ident.
|
void |
setDigitSubstitutionLanguage(int value)
Sets the language that is used when local digits are substituted for western digits.
|
void |
setDigitSubstitutionMethod(int value)
Sets the method to be used for digit substitution.
|
void |
setFormatFlags(int value)
Sets a
com.aspose.imaging.StringFormatFlags enumeration that contains formatting information. |
void |
setHotkeyPrefix(int value)
Sets the
com.aspose.imaging.HotkeyPrefix object for this com.aspose.imaging.StringFormat object. |
void |
setLineAlignment(int value)
Sets the line alignment on the horizontal plane.
|
void |
setTabStops(float firstTabOffset,
float[] tabStops)
Sets tab stops for this
com.aspose.imaging.StringFormat object. |
void |
setTrimming(int value)
Sets the
com.aspose.imaging.StringTrimming enumeration for this com.aspose.imaging.StringFormat object. |
String |
toString()
Converts this
com.aspose.imaging.StringFormat object to a human-readable string. |
close, dispose, getDisposedpublic StringFormat()
Initializes a new com.aspose.imaging.StringFormat object.
public StringFormat(int options)
Initializes a new com.aspose.imaging.StringFormat object with the specified com.aspose.imaging.StringFormatFlags enumeration and language.
options - The com.aspose.imaging.StringFormatFlags enumeration for the new com.aspose.imaging.StringFormat object.public StringFormat(StringFormat format)
Initializes a new com.aspose.imaging.StringFormat object from the specified existing com.aspose.imaging.StringFormat object.
format - The com.aspose.imaging.StringFormat object from which to initialize the new com.aspose.imaging.StringFormat object.com.aspose.ms.System.ArgumentNullException - format is null.public static StringFormat getGenericDefault()
Gets a generic default com.aspose.imaging.StringFormat object.
com.aspose.imaging.StringFormat object.public static StringFormat getGenericTypographic()
Gets a generic typographic com.aspose.imaging.StringFormat object.
com.aspose.imaging.StringFormat object.public int getFormatFlags()
Gets a com.aspose.imaging.StringFormatFlags enumeration that contains formatting information.
com.aspose.imaging.StringFormatFlags enumeration that contains formatting information.public void setFormatFlags(int value)
Sets a com.aspose.imaging.StringFormatFlags enumeration that contains formatting information.
value - A com.aspose.imaging.StringFormatFlags enumeration that contains formatting information.public int getAlignment()
Gets text alignment information on the vertical plane.
com.aspose.imaging.StringAlignment enumeration that specifies text alignment information.public void setAlignment(int value)
Sets text alignment information on the vertical plane.
value - A com.aspose.imaging.StringAlignment enumeration that specifies text alignment information.public int getLineAlignment()
Gets the line alignment on the horizontal plane.
com.aspose.imaging.StringAlignment enumeration that represents the line alignment.public void setLineAlignment(int value)
Sets the line alignment on the horizontal plane.
value - A com.aspose.imaging.StringAlignment enumeration that represents the line alignment.public int getHotkeyPrefix()
Gets the com.aspose.imaging.HotkeyPrefix object for this com.aspose.imaging.StringFormat object.
com.aspose.imaging.HotkeyPrefix object for this com.aspose.imaging.StringFormat object, the default is F:Aspose.Imaging.HotkeyPrefix.None.public void setHotkeyPrefix(int value)
Sets the com.aspose.imaging.HotkeyPrefix object for this com.aspose.imaging.StringFormat object.
value - The com.aspose.imaging.HotkeyPrefix object for this com.aspose.imaging.StringFormat object, the default is F:Aspose.Imaging.HotkeyPrefix.None.public int getTrimming()
Gets the com.aspose.imaging.StringTrimming enumeration for this com.aspose.imaging.StringFormat object.
com.aspose.imaging.StringTrimming enumeration that indicates how text drawn with this com.aspose.imaging.StringFormat object is trimmed when it exceeds the edges of the layout rectangle.public void setTrimming(int value)
Sets the com.aspose.imaging.StringTrimming enumeration for this com.aspose.imaging.StringFormat object.
value - A com.aspose.imaging.StringTrimming enumeration that indicates how text drawn with this com.aspose.imaging.StringFormat object is trimmed when it exceeds the edges of the layout rectangle.public int getDigitSubstitutionMethod()
Gets the method to be used for digit substitution.
com.aspose.imaging.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.
public void setDigitSubstitutionMethod(int value)
Sets the method to be used for digit substitution.
value - A com.aspose.imaging.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.
public int getDigitSubstitutionLanguage()
Gets the language that is used when local digits are substituted for western digits.
P:System.Globalization.CultureInfo.LCID property of a System.Globalization.CultureInfo object as the NLS language identifier.
For example, suppose you create a System.Globalization.CultureInfo object by passing the string "ar-EG" to a System.Globalization.CultureInfo constructor.
If you pass the P:System.Globalization.CultureInfo.LCID property of that System.Globalization.CultureInfo object along with.
com.aspose.imaging.StringDigitSubstitute.Traditional to the com.aspose.imaging.StringFormat.setDigitSubstitution(int, com.aspose.imaging.StringDigitSubstitute) method,
then Arabic-Indic digits will be substituted for western digits at display time.The setter is introduced for the obsolete method setDigitSubstitution.
public void setDigitSubstitutionLanguage(int value)
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 the P:System.Globalization.CultureInfo.LCID property of a System.Globalization.CultureInfo object as the NLS language identifier.
For example, suppose you create a System.Globalization.CultureInfo object by passing the string "ar-EG" to a System.Globalization.CultureInfo constructor.
If you pass the P:System.Globalization.CultureInfo.LCID property of that System.Globalization.CultureInfo object along with.
com.aspose.imaging.StringDigitSubstitute.Traditional to the com.aspose.imaging.StringFormat.setDigitSubstitution(int,com.aspose.imaging.StringDigitSubstitute) method,
then Arabic-Indic digits will be substituted for western digits at display time.The setter is introduced for the obsolete method SetDigitSubstitution.
public float getFirstTabOffset()
Gets the number of spaces between the beginning of a line of text and the first tab stop.
The property is introduced for removed method GetTabStops.
public float[] getTabStops()
Gets an array of distances between tab stops in the units specified by the P:Aspose.Imaging.getGraphics().PageUnit property.
The property is introduced for removed method GetTabStops.
public PointF getCustomCharIdent()
Gets the custom character ident.
Value: The custom character ident.public void setCustomCharIdent(PointF value)
Sets the custom character ident.
Value: The custom character ident.value - the custom character ident.public StringFormat deepClone()
Creates a deep clone of this com.aspose.imaging.StringFormat object.
com.aspose.imaging.StringFormat.public void setTabStops(float firstTabOffset,
float[] tabStops)
Sets tab stops for this com.aspose.imaging.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 com.aspose.imaging.Graphics.PageUnit property.Copyright (c) 2008-2022 Aspose Pty Ltd. All Rights Reserved.