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
T:Aspose.Imaging.StringFormat object. |
StringFormat(int options)
Initializes a new
T:Aspose.Imaging.StringFormat object with the specified T:Aspose.Imaging.StringFormatFlags enumeration and language. |
StringFormat(StringFormat format)
Initializes a new
T:Aspose.Imaging.StringFormat object from the specified existing T:Aspose.Imaging.StringFormat object. |
Modifier and Type | Method and Description |
---|---|
StringFormat |
deepClone()
Creates a deep clone of this
T:Aspose.Imaging.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
T:Aspose.Imaging.StringFormatFlags enumeration that contains formatting information. |
static StringFormat |
getGenericDefault()
Gets a generic default
T:Aspose.Imaging.StringFormat object. |
static StringFormat |
getGenericTypographic()
Gets a generic typographic
T:Aspose.Imaging.StringFormat object. |
int |
getHotkeyPrefix()
Gets or sets the
T:Aspose.Imaging.HotkeyPrefix object for this T:Aspose.Imaging.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.Imaging.Graphics.PageUnit property. |
int |
getTrimming()
Gets or sets the
T:Aspose.Imaging.StringTrimming enumeration for this T:Aspose.Imaging.StringFormat object. |
void |
setAlignment(int value) |
void |
setDigitSubstitutionLanguage(int value) |
void |
setDigitSubstitutionMethod(int value) |
void |
setFormatFlags(int value) |
void |
setHotkeyPrefix(int value) |
void |
setLineAlignment(int value) |
void |
setTabStops(float firstTabOffset,
float[] tabStops)
Sets tab stops for this
T:Aspose.Imaging.StringFormat object. |
void |
setTrimming(int value) |
String |
toString()
Converts this
T:Aspose.Imaging.StringFormat object to a human-readable string. |
dispose, getDisposed
public StringFormat()
Initializes a new T:Aspose.Imaging.StringFormat
object.
public StringFormat(int options)
Initializes a new T:Aspose.Imaging.StringFormat
object with the specified T:Aspose.Imaging.StringFormatFlags
enumeration and language.
options
- The T:Aspose.Imaging.StringFormatFlags
enumeration for the new T:Aspose.Imaging.StringFormat
object.public StringFormat(StringFormat format)
Initializes a new T:Aspose.Imaging.StringFormat
object from the specified existing T:Aspose.Imaging.StringFormat
object.
format
- The T:Aspose.Imaging.StringFormat
object from which to initialize the new T:Aspose.Imaging.StringFormat
object.com.aspose.ms.System.ArgumentNullException
- format
is null.public static StringFormat getGenericDefault()
Gets a generic default T:Aspose.Imaging.StringFormat
object.
T:Aspose.Imaging.StringFormat
object.public static StringFormat getGenericTypographic()
Gets a generic typographic T:Aspose.Imaging.StringFormat
object.
T:Aspose.Imaging.StringFormat
object.public int getFormatFlags()
Gets or sets a T:Aspose.Imaging.StringFormatFlags
enumeration that contains formatting information.
T:Aspose.Imaging.StringFormatFlags
enumeration that contains formatting information.public void setFormatFlags(int value)
public int getAlignment()
Gets or sets text alignment information on the vertical plane.
Value: AT:Aspose.Imaging.StringAlignment
enumeration that specifies text alignment information.public void setAlignment(int value)
public int getLineAlignment()
Gets or sets the line alignment on the horizontal plane.
Value: AT:Aspose.Imaging.StringAlignment
enumeration that represents the line alignment.public void setLineAlignment(int value)
public int getHotkeyPrefix()
Gets or sets the T:Aspose.Imaging.HotkeyPrefix
object for this T:Aspose.Imaging.StringFormat
object.
T:Aspose.Imaging.HotkeyPrefix
object for this T:Aspose.Imaging.StringFormat
object, the default is F:Aspose.Imaging.HotkeyPrefix.None
.public void setHotkeyPrefix(int value)
public int getTrimming()
Gets or sets the T:Aspose.Imaging.StringTrimming
enumeration for this T:Aspose.Imaging.StringFormat
object.
T:Aspose.Imaging.StringTrimming
enumeration that indicates how text drawn with this T:Aspose.Imaging.StringFormat
object is trimmed when it exceeds the edges of the layout rectangle.public void setTrimming(int value)
public int getDigitSubstitutionMethod()
Gets or sets the method to be used for digit substitution.
Value: AT: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)
public 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 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.Imaging.StringDigitSubstitute.Traditional
to the M:Aspose.Imaging.StringFormat.SetDigitSubstitution(System.Int32,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)
public 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.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.Graphics.PageUnit
property.
The property is introduced for removed method GetTabStops.
public StringFormat deepClone()
Creates a deep clone of this T:Aspose.Imaging.StringFormat
object.
T:Aspose.Imaging.StringFormat
.public void setTabStops(float firstTabOffset, float[] tabStops)
Sets tab stops for this T: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 P:Aspose.Imaging.Graphics.PageUnit
property.Copyright (c) 2008-2016 Aspose Pty Ltd. All Rights Reserved.