float
|
ascent()
Return the distance above (negative) the baseline (ascent) based on the
current typeface and text size.
|
int
|
breakText(char[] text, int index, int count, float maxWidth, float[] measuredWidth)
Measure the text, stopping early if the measured width exceeds maxWidth.
|
int
|
breakText(String text, boolean measureForwards, float maxWidth, float[] measuredWidth)
Measure the text, stopping early if the measured width exceeds maxWidth.
|
int
|
breakText(CharSequence text, int start, int end, boolean measureForwards, float maxWidth, float[] measuredWidth)
Measure the text, stopping early if the measured width exceeds maxWidth.
|
void
|
clearShadowLayer()
Clear the shadow layer.
|
float
|
descent()
Return the distance below (positive) the baseline (descent) based on the
current typeface and text size.
|
int
|
getAlpha()
Helper to getColor() that just returns the color's alpha value.
|
int
|
getColor()
Return the paint's color.
|
ColorFilter
|
getColorFilter()
Get the paint's colorfilter (maybe be null).
|
boolean
|
getFillPath(Path src, Path dst)
Applies any/all effects (patheffect, stroking) to src, returning the
result in dst.
|
int
|
getFlags()
Return the paint's flags.
|
String
|
getFontFeatureSettings()
Returns the font feature settings.
|
float
|
getFontMetrics(Paint.FontMetrics metrics)
Return the font's recommended interline spacing, given the Paint's
settings for typeface, textSize, etc.
|
Paint.FontMetrics
|
getFontMetrics()
Allocates a new FontMetrics object, and then calls getFontMetrics(fm)
with it, returning the object.
|
int
|
getFontMetricsInt(Paint.FontMetricsInt fmi)
Return the font's interline spacing, given the Paint's settings for
typeface, textSize, etc.
|
Paint.FontMetricsInt
|
getFontMetricsInt()
|
float
|
getFontSpacing()
Return the recommend line spacing based on the current typeface and
text size.
|
int
|
getHinting()
Return the paint's hinting mode.
|
float
|
getLetterSpacing()
Return the paint's letter-spacing for text.
|
MaskFilter
|
getMaskFilter()
Get the paint's maskfilter object.
|
int
|
getOffsetForAdvance(char[] text, int start, int end, int contextStart, int contextEnd, boolean isRtl, float advance)
Get the character offset within the string whose position is closest to the specified
horizontal position.
|
int
|
getOffsetForAdvance(CharSequence text, int start, int end, int contextStart, int contextEnd, boolean isRtl, float advance)
|
PathEffect
|
getPathEffect()
Get the paint's patheffect object.
|
Rasterizer
|
getRasterizer()
This method was deprecated
in API level 21.
Rasterizer is not supported by either the HW or PDF backends.
|
float
|
getRunAdvance(char[] text, int start, int end, int contextStart, int contextEnd, boolean isRtl, int offset)
Measure cursor position within a run of text.
|
float
|
getRunAdvance(CharSequence text, int start, int end, int contextStart, int contextEnd, boolean isRtl, int offset)
|
Shader
|
getShader()
Get the paint's shader object.
|
Paint.Cap
|
getStrokeCap()
Return the paint's Cap, controlling how the start and end of stroked
lines and paths are treated.
|
Paint.Join
|
getStrokeJoin()
Return the paint's stroke join type.
|
float
|
getStrokeMiter()
Return the paint's stroke miter value.
|
float
|
getStrokeWidth()
Return the width for stroking.
|
Paint.Style
|
getStyle()
Return the paint's style, used for controlling how primitives'
geometries are interpreted (except for drawBitmap, which always assumes
FILL_STYLE).
|
Paint.Align
|
getTextAlign()
Return the paint's Align value for drawing text.
|
void
|
getTextBounds(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).
|
void
|
getTextBounds(char[] text, int index, int count, 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).
|
Locale
|
getTextLocale()
Get the text's primary Locale.
|
LocaleList
|
getTextLocales()
Get the text locale list.
|
void
|
getTextPath(char[] text, int index, int count, float x, float y, Path path)
Return the path (outline) for the specified text.
|
void
|
getTextPath(String text, int start, int end, float x, float y, Path path)
Return the path (outline) for the specified text.
|
float
|
getTextScaleX()
Return the paint's horizontal scale factor for text.
|
float
|
getTextSize()
Return the paint's text size.
|
float
|
getTextSkewX()
Return the paint's horizontal skew factor for text.
|
int
|
getTextWidths(char[] text, int index, int count, float[] widths)
Return the advance widths for the characters in the string.
|
int
|
getTextWidths(String text, float[] widths)
Return the advance widths for the characters in the string.
|
int
|
getTextWidths(String text, int start, int end, float[] widths)
Return the advance widths for the characters in the string.
|
int
|
getTextWidths(CharSequence text, int start, int end, float[] widths)
Return the advance widths for the characters in the string.
|
Typeface
|
getTypeface()
Get the paint's typeface object.
|
Xfermode
|
getXfermode()
Get the paint's xfermode object.
|
boolean
|
hasGlyph(String string)
Determine whether the typeface set on the paint has a glyph supporting the string.
|
final
boolean
|
isAntiAlias()
Helper for getFlags(), returning true if ANTI_ALIAS_FLAG bit is set
AntiAliasing smooths out the edges of what is being drawn, but is has
no impact on the interior of the shape.
|
final
boolean
|
isDither()
Helper for getFlags(), returning true if DITHER_FLAG bit is set
Dithering affects how colors that are higher precision than the device
are down-sampled.
|
boolean
|
isElegantTextHeight()
Get the elegant metrics flag.
|
final
boolean
|
isFakeBoldText()
Helper for getFlags(), returning true if FAKE_BOLD_TEXT_FLAG bit is set
|
final
boolean
|
isFilterBitmap()
Whether or not the bitmap filter is activated.
|
final
boolean
|
isLinearText()
Helper for getFlags(), returning true if LINEAR_TEXT_FLAG bit is set
|
final
boolean
|
isStrikeThruText()
Helper for getFlags(), returning true if STRIKE_THRU_TEXT_FLAG bit is set
|
final
boolean
|
isSubpixelText()
Helper for getFlags(), returning true if SUBPIXEL_TEXT_FLAG bit is set
|
final
boolean
|
isUnderlineText()
Helper for getFlags(), returning true if UNDERLINE_TEXT_FLAG bit is set
|
float
|
measureText(char[] text, int index, int count)
Return the width of the text.
|
float
|
measureText(CharSequence text, int start, int end)
Return the width of the text.
|
float
|
measureText(String text, int start, int end)
Return the width of the text.
|
float
|
measureText(String text)
Return the width of the text.
|
void
|
reset()
Restores the paint to its default settings.
|
void
|
set(Paint src)
Copy the fields from src into this paint.
|
void
|
setARGB(int a, int r, int g, int b)
Helper to setColor(), that takes a,r,g,b and constructs the color int
|
void
|
setAlpha(int a)
Helper to setColor(), that only assigns the color's alpha value,
leaving its r,g,b values unchanged.
|
void
|
setAntiAlias(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.
|
void
|
setColor(int color)
Set the paint's color.
|
ColorFilter
|
setColorFilter(ColorFilter filter)
Set or clear the paint's colorfilter, returning the parameter.
|
void
|
setDither(boolean dither)
Helper for setFlags(), setting or clearing the DITHER_FLAG bit
Dithering affects how colors that are higher precision than the device
are down-sampled.
|
void
|
setElegantTextHeight(boolean elegant)
Set the paint's elegant height metrics flag.
|
void
|
setFakeBoldText(boolean fakeBoldText)
Helper for setFlags(), setting or clearing the FAKE_BOLD_TEXT_FLAG bit
|
void
|
setFilterBitmap(boolean filter)
Helper for setFlags(), setting or clearing the FILTER_BITMAP_FLAG bit.
|
void
|
setFlags(int flags)
Set the paint's flags.
|
void
|
setFontFeatureSettings(String settings)
Set font feature settings.
|
void
|
setHinting(int mode)
Set the paint's hinting mode.
|
void
|
setLetterSpacing(float letterSpacing)
Set the paint's letter-spacing for text.
|
void
|
setLinearText(boolean linearText)
Helper for setFlags(), setting or clearing the LINEAR_TEXT_FLAG bit
|
MaskFilter
|
setMaskFilter(MaskFilter maskfilter)
Set or clear the maskfilter object.
|
PathEffect
|
setPathEffect(PathEffect effect)
Set or clear the patheffect object.
|
Rasterizer
|
setRasterizer(Rasterizer rasterizer)
This method was deprecated
in API level 21.
Rasterizer is not supported by either the HW or PDF backends.
|
Shader
|
setShader(Shader shader)
Set or clear the shader object.
|
void
|
setShadowLayer(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.
|
void
|
setStrikeThruText(boolean strikeThruText)
Helper for setFlags(), setting or clearing the STRIKE_THRU_TEXT_FLAG bit
|
void
|
setStrokeCap(Paint.Cap cap)
Set the paint's Cap.
|
void
|
setStrokeJoin(Paint.Join join)
Set the paint's Join.
|
void
|
setStrokeMiter(float miter)
Set the paint's stroke miter value.
|
void
|
setStrokeWidth(float width)
Set the width for stroking.
|
void
|
setStyle(Paint.Style style)
Set the paint's style, used for controlling how primitives'
geometries are interpreted (except for drawBitmap, which always assumes
Fill).
|
void
|
setSubpixelText(boolean subpixelText)
Helper for setFlags(), setting or clearing the SUBPIXEL_TEXT_FLAG bit
|
void
|
setTextAlign(Paint.Align align)
Set the paint's text alignment.
|
void
|
setTextLocale(Locale locale)
Set the text locale list to a one-member list consisting of just the locale.
|
void
|
setTextLocales(LocaleList locales)
Set the text locale list.
|
void
|
setTextScaleX(float scaleX)
Set the paint's horizontal scale factor for text.
|
void
|
setTextSize(float textSize)
Set the paint's text size.
|
void
|
setTextSkewX(float skewX)
Set the paint's horizontal skew factor for text.
|
Typeface
|
setTypeface(Typeface typeface)
Set or clear the typeface object.
|
void
|
setUnderlineText(boolean underlineText)
Helper for setFlags(), setting or clearing the UNDERLINE_TEXT_FLAG bit
|
Xfermode
|
setXfermode(Xfermode xfermode)
Set or clear the xfermode object.
|