[TYPO3] maxWidth and multi-line text in GIFBUILDER
Rens Admiraal
typo3 at ambitiondesign.nl
Wed Aug 15 15:03:46 CEST 2007
Hi all,
I've created an image with GIFBUILDER which contains multiple lines
of text. I used http://www.typo3wizard.com/en/snippets/gifbuilder/
multiple-line-text-with-gifbuilder.html as example.
The image may contain 3 lines of text, but I don't want text to 'fall
of' the image, so, if the text is to long, the fontsize must be set
to a smaller size. I tried to accomplish this by setting the maxWidth
property, but this applies to all lines individual. So, the first 2
lines have a small font, and the third line is a normal size.
I thought I could solve this by calculating how long the entire text
is with a userfunction, and return the fontsize that should be used,
but somehow this doesn't work.
I have the following typoscript:
temp.fontsize = USER
temp.fontsize.userFunc = tx_quote_pi1->fontsize
temp.quote.file.10.text.fontSize < temp.fontsize
When I set a fixed value (like below) it does work.
temp.fontsize = 9
temp.quote.file.10.text.fontSize < temp.fontsize
The return value of the function is a pos int, and is correct. Also
clearing the cache and so on has no result.
I really hope there is someone who has an answer.
Greetz,
Rens
More information about the TYPO3-english
mailing list