Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Android Text Display - Canvas.drawText() output pixelated

My Android app displays text in a few different ways, and there are some annoying differences between them I was hoping folks could help with.

When I use display methods that might be termed "automatic," the text is displayed very nicely. By automatic methods, I'm referring tools, like Toasts and Button widgets where I just have supply the text, and the OS (or "environment" or whatever) displays it for me. The letters are nicely curved, pleasant to look at, and easily legible.

However, in my code where I handle the text display (using Canvas.drawText() in a Surface Runner View), the text quality is poor. The text is still legible, but it looks pixelated. The letters just don't look their best.

I've tried experimenting with Paint.setTypeface(), using Typeface.SANS_SERIF for example, but the quality of the display when it's my code is always poor. Doable, but poor.

Has anybody else experienced this? By any chance does anybody have a solution?

like image 638
Rich Avatar asked Feb 17 '11 18:02

Rich


1 Answers

You might also try playing around with Paint.setAntiAlias(boolean) or Paint.setSubpixelText(boolean).

like image 154
Kevin Coppock Avatar answered Oct 26 '22 23:10

Kevin Coppock