TextStyle Class

The text appearance parameters' storage.

Declaration

public class TextStyle
extends StyleBase

Inheritance

Inherited Members

java.lang.Object.equals(java.lang.Object)
java.lang.Object.hashCode()
java.lang.Object.notify()
java.lang.Object.notifyAll()
java.lang.Object.toString()
java.lang.Object.wait()
java.lang.Object.wait(long)
java.lang.Object.wait(long, int)

Constructors

TextStyle() Constructor

Initializes a new TextStyle class instance with default parameters.

Declaration

public TextStyle()

Methods

Constructors

TextStyle.getColor() Method

Returns the text color.

Declaration

public Integer getColor()

Returns

Type Description
Integer

The color of text.

TextStyle.getFontFeatureSettings() Method

Returns font feature parameters specified by a string.

Declaration

public String getFontFeatureSettings()

Returns

Type Description
String

A string that contains font feature parameters in the format compatible with the CSS font-feature-settings attribute.

TextStyle.getLetterSpacing() Method

Returns the letter spacing in text.

Declaration

public Float getLetterSpacing()

Returns

Type Description
Float

The letter spacing in em units.

TextStyle.getLocale() Method

Returns the current locale.

Declaration

public Locale getLocale()

Returns

Type Description
Locale

The Locale object that stores information about geographical, political, or cultural region.

TextStyle.getPaintFlags() Method

Returns the paint's flags.

Declaration

public Integer getPaintFlags()

Returns

Type Description
Integer

The paint's flags.

TextStyle.getScaleX() Method

Returns the horizontal scaling of text.

Declaration

public Float getScaleX()

Returns

Type Description
Float

The horizontal scaling.

TextStyle.getShadowColor() Method

Returns the shadow color.

Declaration

public Integer getShadowColor()

Returns

Type Description
Integer

The shadow color.

TextStyle.getShadowDx() Method

Returns the horizontal offset of a text shadow.

Declaration

public Float getShadowDx()

Returns

Type Description
Float

The horizontal offset of a shadow.

TextStyle.getShadowDy() Method

Returns the vertical offset of a text shadow.

Declaration

public Float getShadowDy()

Returns

Type Description
Float

The vertical offset of a shadow.

TextStyle.getShadowRadius() Method

Returns the shadow blur radius.

Declaration

public Float getShadowRadius()

Returns

Type Description
Float

The shadow blur radius.

TextStyle.getSize() Method

Returns the size of text.

Declaration

public Float getSize()

Returns

Type Description
Float

The text size, in scaled pixels.

TextStyle.getSkewX() Method

Returns horizontal skew factor of text.

Declaration

public Float getSkewX()

Returns

Type Description
Float

The horizontal skew factor of text.

TextStyle.getTypeface() Method

Returns the typeface for the text.

Declaration

public Typeface getTypeface()

Returns

Type Description
Typeface

The object that specifies the typeface and intrinsic style of a font.

TextStyle.setColor(Integer) Method

Specifies the text color.

Declaration

public void setColor(Integer color)

Parameters

Type Name Description
Integer color

The color of text.

TextStyle.setFontFeatureSettings(String) Method

Specifies font feature parameters specified by a string.

Declaration

public void setFontFeatureSettings(String fontFeatureSettings)

Parameters

Type Name Description
String fontFeatureSettings

A string that contains font feature parameters in the format compatible with the CSS font-feature-settings attribute.

TextStyle.setLetterSpacing(Float) Method

Specifies the letter spacing in text.

Declaration

public void setLetterSpacing(Float letterSpacing)

Parameters

Type Name Description
Float letterSpacing

The letter spacing in em units.

TextStyle.setLocale(Locale) Method

Specifies the current locale.

Declaration

public void setLocale(Locale locale)

Parameters

Type Name Description
Locale locale

The Locale object that stores information about geographical, political, or cultural region.

TextStyle.setPaintFlags(Integer) Method

Specifies the paint's flags.

Declaration

public void setPaintFlags(Integer paintFlags)

Parameters

Type Name Description
Integer paintFlags

The paint's flags.

TextStyle.setScaleX(Float) Method

Specifies the horizontal scaling of text.

Declaration

public void setScaleX(Float scaleX)

Parameters

Type Name Description
Float scaleX

The horizontal scaling.

TextStyle.setShadowLayer(Float, Float, Float, Integer) Method

Specifies tha parameters of the text shadow.

Declaration

public void setShadowLayer(Float radius, Float dx, Float dy, Integer color)

Parameters

Type Name Description
Float radius

The shadow blur radius. If this value is 0, a shadow is not drawn.

Float dx

The horizontal offset of a text shadow.

Float dy

The vertical offset of a text shadow.

Integer color

The shadow color.

TextStyle.setSize(Float) Method

Specifies the size of text.

Declaration

public void setSize(Float size)

Parameters

Type Name Description
Float size

The text size, in scaled pixels.

TextStyle.setSize(int, Float) Method

Specifies the size of text.

Declaration

public void setSize(int unit, Float size)

Parameters

Type Name Description
int unit

The required measure units of text.

Float size

The text size in pixels.

TextStyle.setSkewX(Float) Method

Specifies horizontal skew factor of text.

Declaration

public void setSkewX(Float skewX)

Parameters

Type Name Description
Float skewX

The horizontal skew factor of text.

TextStyle.setTypeface(Typeface) Method

Specifies the typeface for the text.

Declaration

public void setTypeface(Typeface typeface)

Parameters

Type Name Description
Typeface typeface

The object that specifies the typeface and intrinsic style of a font.