Font Bold - Android Graphics

Android examples for Graphics:Font

Description

Font Bold

Demo Code


//package com.java2s;

import android.graphics.Paint;
import android.graphics.Typeface;

public class Main {
    public static Paint FontBold(int size, int color, boolean shadow) {
        Paint textPaint = new Paint();
        textPaint.setTextSize(size);/*  w  ww .  ja v  a2  s .c  om*/
        textPaint.setColor(color);
        textPaint.setTypeface(Typeface.DEFAULT_BOLD);
        textPaint.setTextAlign(Paint.Align.CENTER);
        textPaint.setAntiAlias(true);
        if (shadow)
            textPaint.setShadowLayer(2, 2, 2, color + 15);
        return textPaint;
    }
}

Related Tutorials