Java android.text TextPaint fields, constructors, methods, implement or subclass

Example usage for Java android.text TextPaint fields, constructors, methods, implement or subclass

Introduction

In this page you can find the methods, fields and constructors for android.text TextPaint.

The text is from its open source code.

Constructor

Method

floatascent()
Return the distance above (negative) the baseline (ascent) based on the current typeface and text size.
intbreakText(CharSequence text, int start, int end, boolean measureForwards, float maxWidth, float[] measuredWidth)
Measure the text, stopping early if the measured width exceeds maxWidth.
intbreakText(String text, boolean measureForwards, float maxWidth, float[] measuredWidth)
Measure the text, stopping early if the measured width exceeds maxWidth.
floatdescent()
Return the distance below (positive) the baseline (descent) based on the current typeface and text size.
intgetColor()
Return the paint's color.
intgetFlags()
Return the paint's flags.
FontMetricsgetFontMetrics()
Allocates a new FontMetrics object, and then calls getFontMetrics(fm) with it, returning the object.
intgetFontMetricsInt(FontMetricsInt fmi)
Return the font's interline spacing, given the Paint's settings for typeface, textSize, etc.
FontMetricsIntgetFontMetricsInt()
AligngetTextAlign()
Return the paint's Align value for drawing text.
voidgetTextBounds(String text, int start, int end, Rect bounds)
Return in bounds (allocated by the caller) the smallest rectangle that encloses all of the characters, with an implied origin at (0,0).
floatgetTextSize()
Return the paint's text size.
intgetTextWidths(char[] text, int index, int count, float[] widths)
Return the advance widths for the characters in the string.
intgetTextWidths(String text, float[] widths)
Return the advance widths for the characters in the string.
TypefacegetTypeface()
Get the paint's typeface object.
floatmeasureText(String text)
Return the width of the text.
floatmeasureText(char[] text, int index, int count)
Return the width of the text.
voidsetAntiAlias(boolean aa)
Helper for setFlags(), setting or clearing the ANTI_ALIAS_FLAG bit AntiAliasing smooths out the edges of what is being drawn, but is has no impact on the interior of the shape.
voidsetColor(@ColorInt int color)
Set the paint's color.
voidsetFakeBoldText(boolean fakeBoldText)
Helper for setFlags(), setting or clearing the FAKE_BOLD_TEXT_FLAG bit
voidsetFlags(int flags)
Set the paint's flags.
voidsetLetterSpacing(float letterSpacing)
Set the paint's letter-spacing for text.
voidsetLinearText(boolean linearText)
Helper for setFlags(), setting or clearing the LINEAR_TEXT_FLAG bit
ShadersetShader(Shader shader)
Set or clear the shader object.
voidsetShadowLayer(float radius, float dx, float dy, int shadowColor)
This draws a shadow layer below the main layer, with the specified offset and color, and blur radius.
voidsetStyle(Style style)
Set the paint's style, used for controlling how primitives' geometries are interpreted (except for drawBitmap, which always assumes Fill).
voidsetTextAlign(Align align)
Set the paint's text alignment.
voidsetTextScaleX(float scaleX)
Set the paint's horizontal scale factor for text.
voidsetTextSize(float textSize)
Set the paint's text size.
TypefacesetTypeface(Typeface typeface)
Set or clear the typeface object.
voidsetUnderlineText(boolean underlineText)
Helper for setFlags(), setting or clearing the UNDERLINE_TEXT_FLAG bit