Skip to main content

TextStyle Class

The text appearance parameters’ storage.

Declaration

public class TextStyle
extends StyleBase

Inherited Members

java.lang.Object.equals(java.lang.Object)(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)(long)
java.lang.Object.wait(long, int)(long,int)

Inheritance

TextStyle()

Initializes a new TextStyle class instance with default parameters.

Declaration

public TextStyle()

Methods

getColor() Method

Returns the text color.

Declaration

public Integer getColor()

Returns

Type Description
Integer

The color of text.

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.

getLetterSpacing() Method

Returns the letter spacing in text.

Declaration

public Float getLetterSpacing()

Returns

Type Description
Float

The letter spacing in em units.

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.

getPaintFlags() Method

Returns the paint’s flags.

Declaration

public Integer getPaintFlags()

Returns

Type Description
Integer

The paint’s flags.

getScaleX() Method

Returns the horizontal scaling of text.

Declaration

public Float getScaleX()

Returns

Type Description
Float

The horizontal scaling.

getShadowColor() Method

Returns the shadow color.

Declaration

public Integer getShadowColor()

Returns

Type Description
Integer

The shadow color.

getShadowDx() Method

Returns the horizontal offset of a text shadow.

Declaration

public Float getShadowDx()

Returns

Type Description
Float

The horizontal offset of a shadow.

getShadowDy() Method

Returns the vertical offset of a text shadow.

Declaration

public Float getShadowDy()

Returns

Type Description
Float

The vertical offset of a shadow.

getShadowRadius() Method

Returns the shadow blur radius.

Declaration

public Float getShadowRadius()

Returns

Type Description
Float

The shadow blur radius.

getSize() Method

Returns the size of text.

Declaration

public Float getSize()

Returns

Type Description
Float

The text size, in scaled pixels.

getSkewX() Method

Returns horizontal skew factor of text.

Declaration

public Float getSkewX()

Returns

Type Description
Float

The horizontal skew factor of text.

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.

setColor(Integer) Method

Specifies the text color.

Declaration

public void setColor(Integer color)

Parameters

Name Type Description
color Integer

The color of text.

setFontFeatureSettings(String) Method

Specifies font feature parameters specified by a string.

Declaration

public void setFontFeatureSettings(String fontFeatureSettings)

Parameters

Name Type Description
fontFeatureSettings String

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

setLetterSpacing(Float) Method

Specifies the letter spacing in text.

Declaration

public void setLetterSpacing(Float letterSpacing)

Parameters

Name Type Description
letterSpacing Float

The letter spacing in em units.

setLocale(Locale) Method

Specifies the current locale.

Declaration

public void setLocale(Locale locale)

Parameters

Name Type Description
locale Locale

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

setPaintFlags(Integer) Method

Specifies the paint’s flags.

Declaration

public void setPaintFlags(Integer paintFlags)

Parameters

Name Type Description
paintFlags Integer

The paint’s flags.

setScaleX(Float) Method

Specifies the horizontal scaling of text.

Declaration

public void setScaleX(Float scaleX)

Parameters

Name Type Description
scaleX Float

The horizontal scaling.

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

Name Type Description
radius Float

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

dx Float

The horizontal offset of a text shadow.

dy Float

The vertical offset of a text shadow.

color Integer

The shadow color.

setSize(Float) Method

Specifies the size of text.

Declaration

public void setSize(Float size)

Parameters

Name Type Description
size Float

The text size, in scaled pixels.

setSize(int, Float) Method

Specifies the size of text.

Declaration

public void setSize(int unit, Float size)

Parameters

Name Type Description
unit int

The required measure units of text.

size Float

The text size in pixels.

setSkewX(Float) Method

Specifies horizontal skew factor of text.

Declaration

public void setSkewX(Float skewX)

Parameters

Name Type Description
skewX Float

The horizontal skew factor of text.

setTypeface(Typeface) Method

Specifies the typeface for the text.

Declaration

public void setTypeface(Typeface typeface)

Parameters

Name Type Description
typeface Typeface

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