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.

eZ debug

Timing: Jan 18 2025 10:32:32
Script start
Timing: Jan 18 2025 10:32:32
Module start 'layout'
Timing: Jan 18 2025 10:32:32
Module start 'content'
Timing: Jan 18 2025 10:32:32
Module end 'content'
Timing: Jan 18 2025 10:32:32
Script end

Main resources:

Total runtime0.0242 sec
Peak memory usage2,048.0000 KB
Database Queries3

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0095 589.0391152.6250
Module start 'layout' 0.00950.0050 741.664139.4453
Module start 'content' 0.01450.0073 781.109489.4453
Module end 'content' 0.02180.0024 870.554730.3047
Script end 0.0242  900.8594 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.002911.7798140.0002
Check MTime0.00114.5948140.0001
Mysql Total
Database connection0.00135.370310.0013
Mysqli_queries0.004418.087930.0015
Looping result0.00000.169310.0000
Template Total0.00198.010.0019
Template load0.00124.813310.0012
Template processing0.00083.165910.0008
Override
Cache load0.00072.840110.0007
General
dbfile0.00145.747280.0002
String conversion0.00000.049240.0000
Note: percentages do not add up to 100% because some accumulators overlap

Templates used to render the page:

UsageRequested templateTemplateTemplate loadedEditOverride
1print_pagelayout.tpl<No override>extension/community/design/community/templates/print_pagelayout.tplEdit templateOverride template
 Number of times templates used: 1
 Number of unique templates used: 1

Time used to render debug report: 0.0001 secs