Render crisp text using Canvas.drawText in Android

android, android-widget

Solution

Paint paint = new Paint(Paint.LINEAR_TEXT_FLAG | Paint.ANTI_ALIAS_FLAG);

did the trick for me

Problem

I'm doing an AppWidget and in its settings I'm letting the user enable/disable text shadow. Since I can't invoke the shadow method through the RemoteViews class, I'm doing a "draw" method that dynamically paints the widget and its container. When drawing the text though, it gets kinda blurred and not that crisp like when using a TextView. The only code I've used for the text painting is: ``` Paint p = new Paint(); p.setAntiAlias(true); p.setColor(Color.WHITE); ``` Are there any other magic I need to do for it to become more crisp?

Original source