4

I have some text i need to wrap inside of a bezier path. On iOS its pretty simple to use Core Text to set the path of the text container and draw. Is there an easy way to do this without using a web view? I need the background of text to be transparent and the rendering to be fast.

APIs appear to be on. Looking for an example of in.. Path is coming from an in-house tool that exports photoshop shapes. It could be:

1/2 circle is just an example. We can have any shape that we want and its not outside. But inside. The path needs to be free form its coming from an in house design tool. Again inside not outside..

enter image description here

Scott Andrew
  • 91
  • 1
  • 7

1 Answers1

-1

I would try this:

  1. Create a Path

    Path path = new Path();

  2. Use Path.quadTo() or Path.cubicTo() methods to draw your curve

and then:

myCanvas.drawTextOnPath(myText, path, offset, 0, myPaint);
Luca Sepe
  • 2,435
  • 1
  • 20
  • 26
  • If I'm reading this api right draws text to the outside. Not inside of the shape. I need to wrap the text block to the inside of the path. Like wrap the text inside a 1/2 moon shape. (just an example). – Scott Andrew Mar 20 '14 at 19:18
  • I see, but if you choose the right radius you can achieve the same effect adding an half circle on the Path like this path.addCircle(x, y, radius, Path.Direction.CW); and then drawTextOnPath – Luca Sepe Mar 20 '14 at 19:33
  • 1/2 circle is just an example. We can have any shape that we want and its not outside. But inside. The path could be: ************************* ° ° ° ° – Scott Andrew Mar 20 '14 at 19:44
  • Ok, understood, for what I know, the only way to draw text _on_ any path using the standard API is this. I wish you good work. Have a great day. – Luca Sepe Mar 20 '14 at 19:54