texttoimage and multiline

Author Message

Heiner Wurbs

Monday 24 May 2004 9:14:50 am

Hi all,

is it possible to make or get new lines in texttoimage graphics, if the string exceed a limit or the size of the image (set in texttoimage.ini.append.php WidthAdjustment=300)?

[myfont]
Family=arial
PointSize=12
XAdjustment=0
YAdjustment=0
WidthAdjustment=300
HeightAdjustment=12
BackgroundColor=#ffffff
TextColor=#FFCC00

In Template:

{$node.name|texttoimage('myfont')}

Btw, I'm using imagemagick.

Any help is appreciated!
Heiner

Ronan Guilloux

Wednesday 27 August 2008 3:29:52 am

You can use wrap operator on texttoimage :

{$node.name|wrap(20)|texttoimage( 'arial',,20,,,'#064D95',,,,5 )}

or use a special character (like '$') to introduce a word wrap at a specific place in the string :

{if $node.name.content|contains('$')}
{def $wrappedTitleArr = $node.name.content|explode( '$' )}
<h2>
{for 0 to $wrappedTitleArr|count|dec as $counter}
{$wrappedTitleArr[$counter]|texttoimage( 'arial',,20,,,'#064D95',,,,5 )}
{delimiter}<br />{/delimiter}
{/for}
</h2>
{undef $wrappedTitleArr}
{/if}

--
Ronan Guilloux
www.mazedia.fr
www.coolforest.net

Powered by eZ Publish™ CMS Open Source Web Content Management. Copyright © 1999-2014 eZ Systems AS (except where otherwise noted). All rights reserved.