Client API. The Codename One framework your app is built on: this runs on the device, not in a backend.
public final class TextRun
- Object
- TextRun
A stretch of text with one style.
Constructors
public TextRun(String text, String fontFamily, float size, ArtPaint fill) | Creates a run. |
Methods
public TextRun copy() | A deep copy. |
public String getText() | The characters. |
public void setText(String text) | Sets the characters. |
public String getFontFamily() | The family name, or null. |
public void setFontFamily(String fontFamily) | Sets the family. |
public float getSize() | The size in the node’s units. |
public void setSize(float size) | Sets the size. |
public boolean isBold() | True for bold. |
public void setBold(boolean bold) | Sets bold. |
public boolean isItalic() | True for italic. |
public void setItalic(boolean italic) | Sets italic. |
public boolean isUnderline() | True for underline. |
public void setUnderline(boolean underline) | Sets underline. |
public boolean isStrikethrough() | True for strikethrough. |
public void setStrikethrough(boolean strikethrough) | Sets strikethrough. |
public ArtPaint getFill() | The text paint. |
public void setFill(ArtPaint fill) | Sets the text paint. |
public float getLetterSpacing() | Extra space between characters, in the node’s units. |
public void setLetterSpacing(float letterSpacing) | Sets the letter spacing. |
Inherited methods
Constructor details
TextRun
public TextRun(String text, String fontFamily, float size, ArtPaint fill)Creates a run.
Parameters
textString- the characters;
\nbreaks a line fontFamilyString- the family name, or null for the default
sizefloat- the font size in the node’s units
fillArtPaint- the text color or paint
Method details
copy
public TextRun copy()A deep copy.
getText
public String getText()The characters.
setText
public void setText(String text)Sets the characters.
Parameters
textString- the characters
getFontFamily
public String getFontFamily()The family name, or null.
setFontFamily
public void setFontFamily(String fontFamily)Sets the family.
Parameters
fontFamilyString- the family name
getSize
public float getSize()The size in the node’s units.
setSize
public void setSize(float size)Sets the size.
Parameters
sizefloat- the size
isBold
public boolean isBold()True for bold.
setBold
public void setBold(boolean bold)Sets bold.
Parameters
boldboolean- true for bold
isItalic
public boolean isItalic()True for italic.
setItalic
public void setItalic(boolean italic)Sets italic.
Parameters
italicboolean- true for italic
isUnderline
public boolean isUnderline()True for underline.
setUnderline
public void setUnderline(boolean underline)Sets underline.
Parameters
underlineboolean- true to underline
isStrikethrough
public boolean isStrikethrough()True for strikethrough.
setStrikethrough
public void setStrikethrough(boolean strikethrough)Sets strikethrough.
Parameters
strikethroughboolean- true to strike through
getFill
public ArtPaint getFill()The text paint.
setFill
public void setFill(ArtPaint fill)Sets the text paint.
Parameters
fillArtPaint- the paint
getLetterSpacing
public float getLetterSpacing()Extra space between characters, in the node’s units.
setLetterSpacing
public void setLetterSpacing(float letterSpacing)Sets the letter spacing.
Parameters
letterSpacingfloat- extra space between characters