Class TextRun

java.lang.Object
com.codename1.art.TextRun

public final class TextRun extends Object
A stretch of text with one style.
  • Constructor Details

    • TextRun

      public TextRun(String text, String fontFamily, float size, ArtPaint fill)

      Creates a run.

      Parameters
      • text: the characters; \n breaks a line
      • fontFamily: the family name, or null for the default
      • size: the font size in the node's units
      • fill: 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
      • text: the characters
    • getFontFamily

      public String getFontFamily()
      The family name, or null.
    • setFontFamily

      public void setFontFamily(String fontFamily)

      Sets the family.

      Parameters
      • fontFamily: the family name
    • getSize

      public float getSize()
      The size in the node's units.
    • setSize

      public void setSize(float size)

      Sets the size.

      Parameters
      • size: the size
    • isBold

      public boolean isBold()
      True for bold.
    • setBold

      public void setBold(boolean bold)

      Sets bold.

      Parameters
      • bold: true for bold
    • isItalic

      public boolean isItalic()
      True for italic.
    • setItalic

      public void setItalic(boolean italic)

      Sets italic.

      Parameters
      • italic: true for italic
    • isUnderline

      public boolean isUnderline()
      True for underline.
    • setUnderline

      public void setUnderline(boolean underline)

      Sets underline.

      Parameters
      • underline: true to underline
    • isStrikethrough

      public boolean isStrikethrough()
      True for strikethrough.
    • setStrikethrough

      public void setStrikethrough(boolean strikethrough)

      Sets strikethrough.

      Parameters
      • strikethrough: true to strike through
    • getFill

      public ArtPaint getFill()
      The text paint.
    • setFill

      public void setFill(ArtPaint fill)

      Sets the text paint.

      Parameters
      • fill: 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
      • letterSpacing: extra space between characters