Code example for TextPaint

Methods: setAntiAlias, setColor, setTextAlign, setTextSize

0
        fillPaint.setStyle(Paint.Style.FILL);
        return fillPaint;
    } 
 
    private TextPaint textPaint() {
        final TextPaint paint = new TextPaint();
        paint.setColor(Color.BLACK);
//        paint.setColor(Color.WHITE); 
        paint.setAntiAlias(true);
        paint.setTextSize(24);
        paint.setTextAlign(Paint.Align.CENTER);
        return paint;
    } 
 
    public float getAspectRatio() { 
        return aspectRatio;
    } 
 
    public void setAspectRatio(float aspectRatio) {
        if (this.aspectRatio != aspectRatio) {
            this.aspectRatio = aspectRatio;