Page 1 of 1

Liquid text container (Rectangle) ?

PostPosted: Wed Aug 22, 2012 4:29 am
by sramanandi
Is there any way to make a text container (Rectangle shape) liquid, so that the container will adjust as per the length of the text and elements below it (say image below a text) does not cover the text.

Re: Liquid text container (Rectangle) ?

PostPosted: Wed Aug 22, 2012 7:18 pm
by jason
Sure.

As explained in Getting Started, to find out, you'd create a suitable pptx in Powerpoint, save, unzip and inspect.

Here is what I found when I did that. In each case, note contents of a:bodyPr, including its @wrap:

Liquid layout ("resize shape to fit text"):

Syntax: [ Download ] [ Hide ]
Using xml Syntax Highlighting
<p:txBody>
          <a:bodyPr wrap="none" rtlCol="0">
            <a:spAutoFit/>
          </a:bodyPr>
          <a:lstStyle/>
          <a:p>
            <a:r>
              <a:rPr lang="en-AU" dirty="0" smtClean="0"/>
              <a:t>Liquid – resize shape to fit text</a:t>
            </a:r>
            <a:endParaRPr lang="en-AU" dirty="0"/>
          </a:p>
        </p:txBody>
 
Parsed in 0.001 seconds, using GeSHi 1.0.8.4


Other possibilities:-

Do not autofit (not so useful, on its own, since it is similar to the above)

Syntax: [ Download ] [ Hide ]
Using xml Syntax Highlighting
        <p:txBody>
          <a:bodyPr wrap="none" rtlCol="0">
            <a:noAutofit/>
          </a:bodyPr>
          <a:lstStyle/>
          <a:p>
            <a:r>
              <a:rPr lang="en-AU" dirty="0" smtClean="0"/>
              <a:t>Do not </a:t>
            </a:r>
            <a:r>
              <a:rPr lang="en-AU" dirty="0" err="1" smtClean="0"/>
              <a:t>autofit</a:t>
            </a:r>
            <a:endParaRPr lang="en-AU" dirty="0"/>
          </a:p>
        </p:txBody>

 
Parsed in 0.002 seconds, using GeSHi 1.0.8.4


Do not autofit; but wrap text in shape:

Syntax: [ Download ] [ Hide ]
Using xml Syntax Highlighting
        <p:txBody>
          <a:bodyPr wrap="square" rtlCol="0">
            <a:noAutofit/>
          </a:bodyPr>
          <a:lstStyle/>
          <a:p>
            <a:r>
              <a:rPr lang="en-AU" dirty="0" smtClean="0"/>
              <a:t>Do not </a:t>
            </a:r>
            <a:r>
              <a:rPr lang="en-AU" dirty="0" err="1" smtClean="0"/>
              <a:t>autofit</a:t>
            </a:r>
            <a:endParaRPr lang="en-AU" dirty="0" smtClean="0"/>
          </a:p>
          <a:p>
            <a:endParaRPr lang="en-AU" dirty="0"/>
          </a:p>
          <a:p>
            <a:r>
              <a:rPr lang="en-AU" dirty="0" smtClean="0"/>
              <a:t>Wrap text in shape</a:t>
            </a:r>
            <a:endParaRPr lang="en-AU" dirty="0"/>
          </a:p>
        </p:txBody>
 
Parsed in 0.002 seconds, using GeSHi 1.0.8.4


Shrink text on overflow:

Syntax: [ Download ] [ Hide ]
Using xml Syntax Highlighting
        <p:txBody>
          <a:bodyPr wrap="square" rtlCol="0">
            <a:normAutofit fontScale="47500" lnSpcReduction="20000"/>
          </a:bodyPr>
          <a:lstStyle/>
          <a:p>
            <a:r>
              <a:rPr lang="en-AU" dirty="0" smtClean="0"/>
              <a:t>Shrink text on overflow</a:t>
            </a:r>
          </a:p>
          <a:p>
            <a:r>
              <a:rPr lang="en-AU" dirty="0" smtClean="0"/>
              <a:t>- only works if you have “wrap text in shape” selected</a:t>
            </a:r>
            <a:endParaRPr lang="en-AU" dirty="0"/>
          </a:p>
        </p:txBody>

 
Parsed in 0.002 seconds, using GeSHi 1.0.8.4


When you work out the Java code to do this (refer Getting Started), you might post your results here for the benefit of someone else. thanks!

Re: Liquid text container (Rectangle) ?

PostPosted: Wed Aug 22, 2012 7:28 pm
by sramanandi
Thanks a lot for the reply Jason..

Before I actually make the java changes, can you clarify if this would affect the flow of other elements which are after the text container.
We have an image just below the square and when text length is bigger the text goes behind the image.. would your solution fix that issue ?

Re: Liquid text container (Rectangle) ?

PostPosted: Wed Aug 22, 2012 11:59 pm
by jason
sramanandi wrote:the text goes behind the image


In Powerpoint you can "bring forward" / bring to front / send backward .. you'll need to play with that and work out how it is implemented in OpenXML

Re: Liquid text container (Rectangle) ?

PostPosted: Thu Aug 23, 2012 3:34 am
by sramanandi
I think bring forward or bring to front isnt some thing I am looking for.
When the text is larger, I dont wan't image to cover text or text to cover image, I want image to be pushed down and create more space for text.
Its like some thing like html.. where there is a paragraph and then an image, no matter how much text is there in paragraph the image element would start after text (no absolute position)

Re: Liquid text container (Rectangle) ?

PostPosted: Thu Aug 23, 2012 9:25 am
by jason
I don't think Powerpoint works like that.

I might be wrong .. please ask on http://www.msofficeforums.com/powerpoint/ or http://answers.microsoft.com/en-us/offi ... powerpoint and let us know what they say. They might have ideas for how best to achieve the effect you want, for example putting the things in table cells.