Auto resize font size in a fixed block container

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

Auto resize font size in a fixed block container

harveyb
Hi all,

I have a fixed element block container and I want the font size of the text inside to reduce accordingly with the amount of text inside the block.

e.g.

<fo:block-container width="200pt" height="20pt"
                       border="1pt solid black"
                       reference-orientation="0">
  <fo:block text-align="left" font-size="100%">
        Regular text. Regular text. Regular text. Regular text. Regular text.
  </fo:block>
</fo:block-container>


if I have

        Regular text. Regular text. Regular text. Regular text. Regular text.

Then it would be like 12pt

but if it was just

        Regular text.

Then it would be able to take up more space and be like 24pt maybe?

And if it was really long like

        Regular text. Regular text. Regular text. Regular text. Regular text. Regular text. Regular text. Regular text. Regular text. Regular text. Regular text. Regular text. Regular text. Regular text. Regular text. Regular text.

Then it would reduce even more to something like 6pt?


How do I do this in XSL-FO? I'm using the RenderX rendering solution so if it is a RenderX extension to achieve this then thats ok.