FileDocCategorySizeDatePackage
TextPaint.javaAPI DocAndroid 5.1 API2251Thu Mar 12 22:22:10 GMT 2015android.text

TextPaint

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

Fields Summary
public int
bgColor
public int
baselineShift
public int
linkColor
public int[]
drawableState
public float
density
public int
underlineColor
Special value 0 means no custom underline
public float
underlineThickness
Defined as a multiplier of the default underline thickness. Use 1.0f for default thickness.
Constructors Summary
public TextPaint()


      
        super();
    
public TextPaint(int flags)

        super(flags);
    
public TextPaint(android.graphics.Paint p)

        super(p);
    
Methods Summary
public voidset(android.text.TextPaint tp)
Copy the fields from tp into this TextPaint, including the fields inherited from Paint.

        super.set(tp);

        bgColor = tp.bgColor;
        baselineShift = tp.baselineShift;
        linkColor = tp.linkColor;
        drawableState = tp.drawableState;
        density = tp.density;
        underlineColor = tp.underlineColor;
        underlineThickness = tp.underlineThickness;
    
public voidsetUnderlineText(int color, float thickness)
Defines a custom underline for this Paint.

param
color underline solid color
param
thickness underline thickness
hide

        underlineColor = color;
        underlineThickness = thickness;