Home > Tutorials > Image Processing – Draw Text on a Curve

Image Processing – Draw Text on a Curve

Just watching on StackOverflow and found this interesting question: How to write curve text?

Here what I’ve tried so far:

Drawing Text on a Curve

Drawing Text on a Curve

Here my implementation:

package pete.android.study;

import android.content.Context;
import android.graphics.Canvas;
import android.graphics.Color;
import android.graphics.Paint;
import android.graphics.Path;

import android.graphics.RectF;
import android.view.View;

public class GraphicsView extends View {
    private static final String MY_TEXT = "xjaphx: Draw Text on Curve";
    private Path mArc;

    private Paint mPaintText;

    public GraphicsView(Context context) {

      mArc = new Path();
      RectF oval = new RectF(50,100,200,250);;
      mArc.addArc(oval, -180, 200);
      mPaintText = new Paint(Paint.ANTI_ALIAS_FLAG);


    protected void onDraw(Canvas canvas) {
      canvas.drawTextOnPath(MY_TEXT, mArc, 0, 20, mPaintText);

Enjoy painting Android 🙂

Pete Houston

Categories: Tutorials Tags: , , ,
  1. Ali
    April 9, 2015 at 2:18 pm

    I have a same question plz tell me how to used this code ???????

  2. aditay kaushal
    February 27, 2014 at 8:17 pm

    how to use this code.

  1. No trackbacks yet.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s

%d bloggers like this: