drawTextOnPath does not render the text properly

233 Views Asked by At

I want to draw a circle and a pointer which moves along the path. I am able to write text properly on the path. But on the pointer the text gets truncated/overlapped. Tried increasing the textSize and the spanSize with no gain. Below is the code.

        canvas.drawPath(mCirclePonterPath, mPointerPaint);

        numberPaint.setColor(Color.parseColor("#ffffff"));
        numberPaint.setAntiAlias(true);
        numberPaint.setStyle(Paint.Style.STROKE);
        numberPaint.setTextAlign(Paint.Align.LEFT);
        numberPaint.setTextSize(65f);

        canvas.drawTextOnPath("10",mCirclePonterPath,0,0,numberPaint);

Attached is the image for reference.

The pointer is the black circle where I want to display the number 10

0

There are 0 best solutions below