Write a text in the pre-define path
<p>I would like to write text along a path shaped like a capital <code>Z</code> letter.</p>

<p>I wrote the following code. It draws the text along a rectangle.<br>
What do I need to do to create a <code>Z</code>-shaped path and have the text follow it?</p>

<pre><code>protected void onCreate(Bundle savedInstanceState) 
      {
        super.onCreate(savedInstanceState);
        Display display = getWindowManager().getDefaultDisplay();
        setContentView(new SampleView(this,display.getWidth(),display.getHeight()));
      }

      private static class SampleView extends View 
      {
        int width;
        int height;
        public SampleView(Context context,int w,int h) 
        {
          super(context);
          width=w;
          height=h;
        }

        @Override
        protected void onDraw(Canvas canvas) 
        { 
            Path mypath = new Path();

            mypath.addRect(width/2,height/2,width,height,Path.Direction.CCW);

            // set the color and font size
            Paint paint = new Paint();
            paint.setColor(Color.RED);
            paint.setTextSize(30);
            paint.setAntiAlias(true);

            // draw the text along the circle
            canvas.drawTextOnPath("Hi This Is Sample String",mypath, 0, 30, paint);
        }
      }
    }
</code></pre>
