public class TextState extends Object
Represents a text state of a text
Modifier and Type | Field and Description |
---|---|
float |
TabstopDefaultValue
Default value of tabulation in widths of space character of default font.
|
String |
TabTag
You can place this tag in text to declare tabulation.
|
Constructor and Description |
---|
TextState()
Creates text state object.
|
TextState(Color foregroundColor)
Creates text state object with foreground color specification.
|
TextState(Color foregroundColor,
double fontSize)
Creates text state object with foreground color and font size specification.
|
TextState(double fontSize)
Creates text state object with font size specification.
|
TextState(String fontFamily)
Creates text state object with font family specification.
|
TextState(String fontFamily,
boolean bold,
boolean italic)
Creates text state object with font family and font style specification.
|
TextState(String fontFamily,
double fontSize)
Creates text state object with font family and font size specification.
|
Modifier and Type | Method and Description |
---|---|
void |
applyChangesFrom(TextState textState)
Applies settings from another textState
|
double |
calculateFontSize(String str,
Rectangle rect)
Calculates the font size for the rectangle.
|
Color |
getBackgroundColor()
Gets background color of the text.
|
float |
getCharacterSpacing()
Gets character spacing of the text.
|
Font |
getFont()
Gets font of the text.
|
float |
getFontSize()
Gets font size of the text.
|
Color |
getForegroundColor()
Gets foreground color of the text.
|
int |
getHorizontalAlignment()
Gets horizontal alignment for the text.
|
float |
getHorizontalScaling()
Gets horizontal scaling of the text.
|
float |
getLineSpacing()
Gets line spacing of the text.
|
boolean |
getStrikeOut()
Gets strikeout for the text, represented by the
TextFragment object |
float |
getWordSpacing()
Gets word spacing of the text.
|
boolean |
isInvisible()
Gets invisibility of the text.
|
boolean |
isSubscript()
Gets or sets subscript of the text.
|
boolean |
isSuperscript()
Gets superscript of the text.
|
boolean |
isUnderline()
Gets underline for the text, represented by the
TextFragment object |
void |
setBackgroundColor(Color value)
Sets background color of the text.
|
void |
setCharacterSpacing(float value)
Sets character spacing of the text.
|
void |
setFont(Font value)
Gets font of the text.
|
void |
setFontSize(float value)
Sets font size of the text.
|
void |
setFontStyle(int value)
Sets font style of the text.
|
void |
setForegroundColor(Color value)
Sets foreground color of the text.
|
void |
setHorizontalAlignment(int value)
Sets horizontal alignment for the text.
|
void |
setHorizontalScaling(float value)
Sets horizontal scaling of the text.
|
void |
setInvisible(boolean value)
Sets invisibility of the text.
|
void |
setLineSpacing(float value)
Sets line spacing of the text.
|
void |
setStrikeOut(boolean value)
Sets strikeout for the text, represented by the
TextFragment object |
void |
setSubscript(boolean value)
Gets or sets subscript of the text.
|
void |
setSuperscript(boolean value)
Sets superscript of the text.
|
void |
setUnderline(boolean value)
Sets underline for the text, represented by the
TextFragment object |
void |
setWordSpacing(float value)
Sets word spacing of the text.
|
public final String TabTag
You can place this tag in text to declare tabulation.
TabStops
.
public final float TabstopDefaultValue
Default value of tabulation in widths of space character of default font.
public TextState()
Creates text state object.
public TextState(double fontSize)
Creates text state object with font size specification.
fontSize
- Font size.public TextState(Color foregroundColor)
Creates text state object with foreground color specification.
foregroundColor
- Foreground color.public TextState(Color foregroundColor, double fontSize)
Creates text state object with foreground color and font size specification.
foregroundColor
- Foreground color.fontSize
- Font size.public TextState(String fontFamily)
Creates text state object with font family specification.
fontFamily
- Font family.public TextState(String fontFamily, boolean bold, boolean italic)
Creates text state object with font family and font style specification.
fontFamily
- Font family.bold
- Bold font style.italic
- Italic font style.public TextState(String fontFamily, double fontSize)
Creates text state object with font family and font size specification.
fontFamily
- Font family.fontSize
- Font size.public void applyChangesFrom(TextState textState)
Applies settings from another textState
textState
-
textState
- Text state object.public float getCharacterSpacing()
Gets character spacing of the text.
public void setCharacterSpacing(float value)
Sets character spacing of the text.
value
- float valuepublic float getLineSpacing()
Gets line spacing of the text.
public void setLineSpacing(float value)
Sets line spacing of the text.
value
- float value
public float getHorizontalScaling()
Gets horizontal scaling of the text.
public void setHorizontalScaling(float value)
Sets horizontal scaling of the text.
value
- float valuepublic boolean isSubscript()
Gets or sets subscript of the text.
public void setSubscript(boolean value)
Gets or sets subscript of the text.
value
- boolean valuepublic boolean isSuperscript()
Gets superscript of the text.
public void setSuperscript(boolean value)
Sets superscript of the text.
value
- boolean valuepublic float getWordSpacing()
Gets word spacing of the text.
public void setWordSpacing(float value)
Sets word spacing of the text.
value
- float valuepublic boolean isInvisible()
Gets invisibility of the text.
public void setInvisible(boolean value)
Sets invisibility of the text.
value
- boolean valuepublic float getFontSize()
Gets font size of the text.
public void setFontSize(float value)
Sets font size of the text.
value
- float valuepublic Font getFont()
Gets font of the text.
public void setFont(Font value)
Gets font of the text.
value
- Font objectpublic Color getForegroundColor()
Gets foreground color of the text.
public void setForegroundColor(Color value)
Sets foreground color of the text.
value
- Color valuepublic boolean isUnderline()
Gets underline for the text, represented by the TextFragment
object
public void setUnderline(boolean value)
Sets underline for the text, represented by the TextFragment
object
value
- boolean valuepublic boolean getStrikeOut()
Gets strikeout for the text, represented by the TextFragment
object
public void setStrikeOut(boolean value)
Sets strikeout for the text, represented by the TextFragment
object
value
- boolean valuepublic Color getBackgroundColor()
Gets background color of the text.
public void setBackgroundColor(Color value)
Sets background color of the text.
value
- Color valuepublic void setFontStyle(int value)
Sets font style of the text.
value
- FontStyles valueFontStyles
public int getHorizontalAlignment()
Gets horizontal alignment for the text.
HorizontalAlignment
public void setHorizontalAlignment(int value)
Sets horizontal alignment for the text.
value
- HorizontalAlignment valueHorizontalAlignment
Copyright © 2016 Aspose. All Rights Reserved.