public final class FormattedText extends Object
Class which represents formatted text. Contains information about text and its color, size, style.
Modifier and Type | Field and Description |
---|---|
com.aspose.ms.System.Collections.Generic.Dictionary<Integer,Float> |
mpCustomLineSpacing
For Internal usage only
|
Constructor and Description |
---|
FormattedText()
Initializes FormattedText.
|
FormattedText(String text)
Initializes FormattedText.
|
FormattedText(String text,
Color textColor,
Color backColor)
Initializes FormattedText.
|
FormattedText(String text,
Color textColor,
Color backColor,
int textFont,
int encoding,
boolean embedded,
float textSize)
Initializes FormattedText.
|
FormattedText(String text,
Color textColor,
Color backColor,
int textFont,
int textEncoding,
boolean embedded,
float textSize,
float lineSpacing)
Initializes FormattedText.
|
FormattedText(String text,
Color textColor,
Color backColor,
String fontName,
int textEncoding,
boolean embedded,
float fontSize)
Initializes FormattedText.
|
FormattedText(String text,
Color color,
int textFont,
int textEncoding,
boolean embedded,
float textSize)
Initializes FormattedText.
|
FormattedText(String text,
Color textColor,
int textFont,
int textEncoding,
boolean embedded,
float textSize,
float lineSpacing)
Initializes FormattedText.
|
FormattedText(String text,
Color textColor,
String fontName,
int textEncoding,
boolean embedded,
float fontSize)
Initializes FormattedText.
|
FormattedText(String text,
FontColor textColor,
FontColor backColor,
int textFont,
int textEncoding,
boolean embedded,
float textSize)
Initializes FormattedText.
|
FormattedText(String text,
FontColor textColor,
FontColor backColor,
int textFont,
int textEncoding,
boolean embedded,
float textSize,
float lineSpacing)
Initializes FormattedText.
|
FormattedText(String text,
FontColor fontColor,
int fontStyle,
int encodingType,
boolean embedded,
float textSize)
Initializes FormattedText.
|
FormattedText(String text,
FontColor fontColor,
int textFont,
int textEncoding,
boolean embedded,
float textSize,
float lineSpacing)
Initialize FormattedText.
|
Modifier and Type | Method and Description |
---|---|
void |
addNewLineText(String newLineText)
Adds a new line to the FormattedText object and sets the newLineText to the next line's text.
|
void |
addNewLineText(String newLineText,
float lineSpacing)
Adds a new line to the FormattedText object and sets the newLineText to the next line's text.
|
com.aspose.ms.System.Drawing.Color |
getBackColor()
Internal Gets back color
|
String |
getFirstLine()
Gets first line
|
Font |
getFont()
Gets font
|
float |
getFontSize()
Gets font size
|
com.aspose.ms.System.Collections.Generic.Dictionary<Integer,Float> |
getMpCustomLineSpacing()
For Internal usage only
|
com.aspose.ms.System.Collections.Generic.List<String> |
getText()
For Internal usage only
|
com.aspose.ms.System.Drawing.Color |
getTextColor()
Internal Gets text color
|
float |
getTextHeight()
Gets height of text.
|
float |
getTextWidth()
Gets width of text.
|
public FormattedText()
Initializes FormattedText.
public FormattedText(String text)
Initializes FormattedText.
text
- Text which contained in FormattedText.public FormattedText(String text, FontColor fontColor, int fontStyle, int encodingType, boolean embedded, float textSize)
Initializes FormattedText.
text
- Text content of the string.fontColor
- Color of the text.fontStyle
- Style of the text.encodingType
- Encoding type (value of EncodingType enumeration).embedded
- True if the font will be embedded.textSize
- Size of the text.FontStyle
,
EncodingType
public FormattedText(String text, FontColor fontColor, int textFont, int textEncoding, boolean embedded, float textSize, float lineSpacing)
Initialize FormattedText.
text
- Text content of the string.fontColor
- Color of the text.textFont
- Font of the text.textEncoding
- Encoding of the text.embedded
- True if text will be embedded.textSize
- Size of the text.lineSpacing
- Additional spacing.FontStyle
,
EncodingType
public FormattedText(String text, Color color, int textFont, int textEncoding, boolean embedded, float textSize)
Initializes FormattedText.
text
- Text content of the string.color
- Color of the text.textFont
- Font of the text.textEncoding
- Encoding of the text.embedded
- True if text will be embedded.textSize
- Size of the text.FontStyle
,
EncodingType
public FormattedText(String text, Color textColor, int textFont, int textEncoding, boolean embedded, float textSize, float lineSpacing)
Initializes FormattedText.
text
- Text contents of the string.textColor
- Color of the text.textFont
- Font of the text.textEncoding
- Encoding of the text.embedded
- If true font will be embedded.textSize
- Size of the text.lineSpacing
- Additional spacing.FontStyle
,
EncodingType
public FormattedText(String text, FontColor textColor, FontColor backColor, int textFont, int textEncoding, boolean embedded, float textSize)
Initializes FormattedText.
text
- Text content of the string.textColor
- Color of the text.backColor
- Color of background.textFont
- Font of the text.textEncoding
- Encoding of the text.embedded
- If true font will be embedded.textSize
- Size of the text.FontStyle
,
EncodingType
public FormattedText(String text, FontColor textColor, FontColor backColor, int textFont, int textEncoding, boolean embedded, float textSize, float lineSpacing)
Initializes FormattedText.
text
- Text content.textColor
- Color of the text.backColor
- Color of background.textFont
- Font of the text.textEncoding
- Encoding of the text.embedded
- If true font will be embedded.textSize
- Size of the text.lineSpacing
- Additional spacing.FontStyle
,
EncodingType
public FormattedText(String text, Color textColor, Color backColor, int textFont, int encoding, boolean embedded, float textSize)
Initializes FormattedText.
text
- Text content of the string.textColor
- Color of the text.backColor
- Color of background.textFont
- Font of the text.encoding
- Encoding of the text.embedded
- True if font will be embedded.textSize
- Size of the text.FontStyle
,
EncodingType
public FormattedText(String text, Color textColor, Color backColor, int textFont, int textEncoding, boolean embedded, float textSize, float lineSpacing)
Initializes FormattedText.
text
- Text contents of the string.textColor
- Color of the text.backColor
- Color of the background.textFont
- Font of the text.textEncoding
- Encoding of the text.embedded
- If true font is embedded.textSize
- Size of the text.lineSpacing
- Additional spacing.FontStyle
,
EncodingType
public FormattedText(String text, Color textColor, Color backColor, String fontName, int textEncoding, boolean embedded, float fontSize)
Initializes FormattedText.
text
- Text content.textColor
- Color of the text.backColor
- Color of background.fontName
- Font of the text.textEncoding
- Encoding of the text.embedded
- If true font will be embedded.fontSize
- Size of the text.EncodingType
public FormattedText(String text, Color textColor, Color backColor)
Initializes FormattedText.
text
- Text content.textColor
- Color of the text.backColor
- Color of background.public FormattedText(String text, Color textColor, String fontName, int textEncoding, boolean embedded, float fontSize)
Initializes FormattedText.
text
- Text content.textColor
- Color of the text.fontName
- Font of the text.textEncoding
- Encoding of the text.embedded
- If true font will be embedded.fontSize
- Size of the text.EncodingType
public com.aspose.ms.System.Collections.Generic.List<String> getText()
public com.aspose.ms.System.Collections.Generic.Dictionary<Integer,Float> getMpCustomLineSpacing()
public String getFirstLine()
Gets first line
public com.aspose.ms.System.Drawing.Color getTextColor()
Internal Gets text color
public com.aspose.ms.System.Drawing.Color getBackColor()
Internal Gets back color
public Font getFont()
Gets font
public float getFontSize()
Gets font size
public float getTextHeight()
Gets height of text.
public float getTextWidth()
Gets width of text.
public void addNewLineText(String newLineText)
Adds a new line to the FormattedText object and sets the newLineText to the next line's text.
newLineText
- Text of new added line.public void addNewLineText(String newLineText, float lineSpacing)
Adds a new line to the FormattedText object and sets the newLineText to the next line's text.
newLineText
- Text of new added line.lineSpacing
- Spacing of the line.