I have an application that contains a custom view, and in it I want to use my own font. Unfortunately, this leads to the visualization of really ugly text.
My custom view extends Surface (and just realized: this is a bad idea), and I am drawing text with the following code:
// p = new Paint(); Typeface font = Typeface.createFromAsset(parent.getAssets(), "komtit.ttf"); p.setColor(Color.BLACK); p.setTypeface(font); c.drawText(this.text, x + width / 2 - p.measureText(this.text) / 2, y + height / 2, p);
The result is as follows:
http://img.skitch.com/20101014-rxw8j8igj1jci2fx9ui32ejcp.jpg
Not fun. I use p.setFlags (Paint.ANTI_ALIAS_FLAG), but even so, the result is simply inconvenient.
So, is there a way to improve custom TTF rendering, or should I just stick with system fonts?
source share