Skip to content

Most visited

Recently visited

navigation

TextPaint

public class TextPaint
extends Paint

java.lang.Object
   ↳ android.graphics.Paint
     ↳ android.text.TextPaint


TextPaint is an extension of Paint that leaves room for some extra data used during text measuring and drawing.

Summary

Inherited constants

From class android.graphics.Paint

Fields

public int baselineShift

public int bgColor

public float density

public int[] drawableState

public int linkColor

Public constructors

TextPaint()
TextPaint(int flags)
TextPaint(Paint p)

Public methods

void set(TextPaint tp)

Copy the fields from tp into this TextPaint, including the fields inherited from Paint.

Inherited methods

From class android.graphics.Paint
From class java.lang.Object

Fields

baselineShift

added in API level 1
int baselineShift

bgColor

added in API level 1
int bgColor

density

added in API level 5
float density

drawableState

added in API level 1
int[] drawableState

linkColor

added in API level 1
int linkColor

Public constructors

TextPaint

added in API level 1
TextPaint ()

TextPaint

added in API level 1
TextPaint (int flags)

Parameters
flags int

TextPaint

added in API level 1
TextPaint (Paint p)

Parameters
p Paint

Public methods

set

added in API level 1
void set (TextPaint tp)

Copy the fields from tp into this TextPaint, including the fields inherited from Paint.

Parameters
tp TextPaint

This site uses cookies to store your preferences for site-specific language and display options.

Get the latest Android developer news and tips that will help you find success on Google Play.

* Required Fields

Hooray!

Follow Google Developers on WeChat

Browse this site in ?

You requested a page in , but your language preference for this site is .

Would you like to change your language preference and browse this site in ? If you want to change your language preference later, use the language menu at the bottom of each page.

This class requires API level or higher

This doc is hidden because your selected API level for the documentation is . You can change the documentation API level with the selector above the left navigation.

For more information about specifying the API level your app requires, read Supporting Different Platform Versions.

Take a short survey?
Help us improve the Android developer experience.
(Sep 2017 survey)