Package snap.text
Class TextStyle
java.lang.Object
snap.text.TextStyle
- All Implemented Interfaces:
Cloneable
A class to hold style attributes for a text run.
-
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionclone()
Standard clone implementation.Clone with new value.Clone with new values.Clone with key/value.Clone with map.boolean
Standard equals implementation.double
Returns the max distance above the baseline for this run font.Returns the text border.double
getCharAdvance
(char aChar) Returns the char advance for a given character.double
Returns the char spacing.getColor()
Returns the color for this run.double
Returns the max distance below the baseline that this font goes.getFont()
Returns the font for this run.Returns the format.double
Returns the default distance between lines for this font.double
Returns the line advance.double
Returns the line height.getLink()
Returns the link.int
Returns the scripting for this run (1=SuperScripting, -1=Subscripting, 0=none).static String
getStyleKey
(Object anAttr) Returns the most likely style key for a given attribute.int
Returns the underline style of this run.int
hashCode()
Standard hashCode implementation.boolean
Returns whether this run is underlined.protected void
Clone with key/value.toString()
Standard toString implementation.
-
Field Details
-
FONT_KEY
- See Also:
-
COLOR_KEY
- See Also:
-
UNDERLINE_KEY
- See Also:
-
BORDER_KEY
- See Also:
-
SCRIPTING_KEY
- See Also:
-
CHAR_SPACING_KEY
- See Also:
-
LINK_KEY
- See Also:
-
FORMAT_KEY
- See Also:
-
DEFAULT
-
MONOSPACE_DEFAULT
-
-
Constructor Details
-
TextStyle
public TextStyle()Creates a new TextStyle. -
TextStyle
Creates a new TextStyle for given attributes.
-
-
Method Details
-
getFont
Returns the font for this run. -
getColor
Returns the color for this run. -
isUnderlined
public boolean isUnderlined()Returns whether this run is underlined. -
getUnderlineStyle
public int getUnderlineStyle()Returns the underline style of this run. -
getScripting
public int getScripting()Returns the scripting for this run (1=SuperScripting, -1=Subscripting, 0=none). -
getCharSpacing
public double getCharSpacing()Returns the char spacing. -
getLink
Returns the link. -
getFormat
Returns the format. -
getBorder
Returns the text border. -
getCharAdvance
public double getCharAdvance(char aChar) Returns the char advance for a given character. -
getAscent
public double getAscent()Returns the max distance above the baseline for this run font. -
getDescent
public double getDescent()Returns the max distance below the baseline that this font goes. -
getLeading
public double getLeading()Returns the default distance between lines for this font. -
getLineHeight
public double getLineHeight()Returns the line height. -
getLineAdvance
public double getLineAdvance()Returns the line advance. -
equals
Standard equals implementation. -
hashCode
public int hashCode()Standard hashCode implementation. -
clone
Standard clone implementation. -
copyFor
Clone with new value. -
copyFor
Clone with new values. -
copyFor
Clone with key/value. -
copyFor
Clone with map. -
setValue
Clone with key/value. -
toString
Standard toString implementation. -
getStyleKey
Returns the most likely style key for a given attribute.
-