I have prepared one custom view, in custom view I have displayed alphabets. It is working fine, but in case of "g" it is displaying like this,
I want to change like this "g". How to change it? Please help me. I used the following code for painting,
Paint mPaint=new Paint();
mPaint.setDither(true);
mPaint.setColor(0xFFFFFFFF);
mPaint.setTextSize(350);
mPaint.setStyle(Paint.Style.STROKE);
mPaint.setStrokeJoin(Paint.Join.ROUND);
mPaint.setStrokeCap(Paint.Cap.ROUND);
mPaint.setStrokeWidth(10);
Typeface typeArial;
typeArial = Typeface.create("arial", Typeface.BOLD);
mPaint.setTypeface(typeArial);
In onDraw(),
bmpCanvas.drawText("g",50, 230,mPaint);
Please help me...
You can achieve it by setting programatically by down loading the text style and place in assets folder,for example to set custom font typeface as follows,try the same in you case for paint object.
TextView txt = (TextView) findViewById(R.id.custom_font);
Typeface font = Typeface.createFromAsset(getAssets(), "Helv Neue 67 Med Cond.ttf");
txt.setTypeface(font);
User contributions licensed under CC BY-SA 3.0