Android2D Change character direction to draw

Change character direction to draw with drawTextOnPath.

drawTextOnPath methods draws text using Path instance.

So if changes Path direction or shape, we can draw fancy style character.

Sample

public class DrawLineText extends View
{
    private static final String TAG = "DrawLineText";
     
    private Paint paint;
     
    private Path path;
     
    public DrawLineText ( Context context )
    {
        super(context);
        paint = new Paint(Paint.ANTI_ALIAS_FLAG);
        path = new Path();
        path.moveTo(250, 0);
        path.lineTo(250, 700);
    }
 
    @Override
    protected void onDraw ( Canvas canvas )
    {
        canvas.drawColor(Color.BLACK);
         
        paint.setColor(Color.WHITE);
        paint.setTextSize(30);
        paint.setFakeBoldText(true);
        paint.setTextAlign(Align.CENTER);
         
        Log.d(TAG, "Width:" + paint.measureText("RotateX"));
        canvas.drawTextOnPath("Rotate", path, 0, 0, paint);
    }
}

Result

rotate