Skip to main content
Known Participant
December 28, 2009
Question

Text Wrapping issue in text

  • December 28, 2009
  • 1 reply
  • 420 views

Hi

     I am creating an application which take the input from the open XML of MS Office, and plot the text same as the powerpoint .

     But the default spacing between the each word of the paragarph not same as  the powerpoint, so the text goes to the new line.

     I attached a file which gives the clear picture.

      so please let me know if anyone know the solution.

     Thanks

This topic has been closed for replies.

1 reply

December 28, 2009

Word spacing is not the only difference. Letter spacing is also tighter in the first image, and line height is also smaller there. Even if you had the same line breaks the last line would overlap the red box in the second image. It looks to me like the character size is slightly larger in the second image as well, but that's harder to judge from this screenshot.

It is going to be impossible to get exactly the same output from the two different composition engines. You are going to have to decide how close is "good enough."

What I would do is this:

1. Decrease fontSize (or lineHeight, if you're happy with the character sizes) by very small amounts until the 14th line of text fits entirely inside the red box

2. Decrease trackingRight by very small amounts until you get roughly similar line breaks. The problem is that the "correct" value for one sample set of text will most likely not work for a different set of text. You'll have to decide what text is representative for your application and choose a tracking value that works best for that set.