I'm trying to draw some text inside the svg path. I need it in the biggest part of the shape. And with normal rotation like in point 1. But currently all I have is the result like in point 2. Could someone help me to achieve the result like in point 1?
I'm using Canvas to draw the Path:
var bitmap = Bitmap.createBitmap(
1000,
1000,
Bitmap.Config.ARGB_8888)
var canvas = Canvas(bitmap)
canvas.drawColor(Color.LTGRAY)
var paint = Paint()
paint.color =Color.GREEN
canvas.drawPath(p, paint)
paint.color = Color.BLACK
paint.setStyle(Paint.Style.FILL)
paint.textSize = 20f
var text= "250"
canvas.drawTextOnPath(text,
p,
50f,0f,
paint)
var rectF = RectF()
pathObject.computeBounds(rectF, true)
//the rectangle to show the rect of the Path
paint.color = Color.TRANSPARENT
paint.setStyle(Paint.Style.STROKE)
paint.color = Color.RED
paint.strokeWidth =2f
canvas.drawRect(rectF,paint)