Hi, I have this method (setText) that creates mTextBitmap with very ugly, blurry and bloated text on it. It is supposed to create nice and neat image with font on it. Any suggestions on where I might be wrong?
- Code: Select all
public void setText(String string) {
final Paint textPaint = new Paint();
textPaint.setAntiAlias(true);
textPaint.setColor(Color.BLACK);
textPaint.setTextSize(32);
textPaint.setTypeface(Typeface.DEFAULT);
final Bitmap textBitmap = Bitmap.createBitmap(256, 256, Bitmap.Config.ARGB_8888);
Canvas textCanvas = new Canvas(textBitmap);
textCanvas.drawText(string, 0, 128, textPaint);
mTextBitmap = textBitmap;
}