Skip to main content
added TextCell case for TextJustification
Source Link
Verbeia
  • 34.5k
  • 10
  • 110
  • 225

Rather than using a Rectangle, consider a PanePane that is Framed

text = "Bunch of random text ";

Framed@Pane[StringJoin @@ Table[text, {10}], 300]

enter image description here

The second argument to Pane determines the width in points.

If you want more control over the text within the Pane, consider putting a TextCell inside the Pane. If you just use a TextCell, you can't control its width.

Framed@Pane[TextCell[StringJoin @@ Table[text, {10}], 13, 
  TextJustification -> 0], 300]

enter image description here

I appreciate that my proposed solution isn't a Graphics object, but it gives you the desired result. The question is whether you need this in a Graphics object or not.

Rather than using a Rectangle, consider a Pane that is Framed

text = "Bunch of random text ";

Framed@Pane[StringJoin @@ Table[text, {10}], 300]

enter image description here

Rather than using a Rectangle, consider a Pane that is Framed

text = "Bunch of random text ";

Framed@Pane[StringJoin @@ Table[text, {10}], 300]

enter image description here

The second argument to Pane determines the width in points.

If you want more control over the text within the Pane, consider putting a TextCell inside the Pane. If you just use a TextCell, you can't control its width.

Framed@Pane[TextCell[StringJoin @@ Table[text, {10}], 13, 
  TextJustification -> 0], 300]

enter image description here

I appreciate that my proposed solution isn't a Graphics object, but it gives you the desired result. The question is whether you need this in a Graphics object or not.

Source Link
Verbeia
  • 34.5k
  • 10
  • 110
  • 225

Rather than using a Rectangle, consider a Pane that is Framed

text = "Bunch of random text ";

Framed@Pane[StringJoin @@ Table[text, {10}], 300]

enter image description here