我创建了一个画布.我在画布上画文字.但是当我在不同版本的android上测试时,文本看起来不同.版本4.х和2.2之间的区别.
Bitmap btmText = Bitmap.createBitmap(140, 90, Bitmap.Config.ARGB_4444);
Canvas cnvText = new Canvas(btmText);
Typeface tf = tf = Typeface.createFromAsset(context.getAssets(),"fonts/font.ttf");
Paint paint = new Paint();
paint.setAntiAlias(true);
paint.setSubpixelText(true);
paint.setTypeface(tf);
paint.setTextSize(50);
cnvText.drawText(text, 0, 5, 0, 55, paint);
Run Code Online (Sandbox Code Playgroud)
android 2.2上的文字看起来比android 4.0.3更大.