Fix 4x8 fonts on API level 4+

(Use a runtime API level check to choose whether to load the nodpi
version.)
This commit is contained in:
Jack Palevich 2012-04-14 13:32:39 -07:00
parent f6693d52ef
commit c3d85685a8
2 changed files with 3 additions and 2 deletions

View File

Before

Width:  |  Height:  |  Size: 974 B

After

Width:  |  Height:  |  Size: 974 B

View File

@ -1110,8 +1110,9 @@ class Bitmap4x8FontRenderer extends BaseTextRenderer {
int forePaintIndex, int forePaintColor,
int backPaintIndex, int backPaintColor) {
super(forePaintIndex, forePaintColor, backPaintIndex, backPaintColor);
mFont = BitmapFactory.decodeResource(resources,
R.drawable.atari_small);
int fontResource = AndroidCompat.SDK <= 3 ? R.drawable.atari_small
: R.drawable.atari_small_nodpi;
mFont = BitmapFactory.decodeResource(resources,fontResource);
mPaint = new Paint();
mPaint.setXfermode(new PorterDuffXfermode(PorterDuff.Mode.SRC_IN));
}