Project

General

Profile

Actions

Bug #20603

closed

align center with breakSpace and breakWidth

Added by bilal almost 15 years ago. Updated over 10 years ago.

Status:
Closed
Priority:
Should have
Assignee:
-
Category:
-
Target version:
-
Start date:
2009-06-09
Due date:
% Done:

0%

Estimated time:
TYPO3 Version:
4.3
PHP Version:
4.3
Tags:
Complexity:
medium
Is Regression:
No
Sprint Focus:

Description

i have a gmenu. in the gmenu i also have this code:
10.align = center
10.offset = 0,15
10.breakWidth = 150
10.breakSpace = 1.2
but the code doesnt generate the result i want. i think its a bug in the new feature 'breakspace/breakwidth'.

the result im getting is attached in this message.

the result i WANT: to position the first 2 lines ('keuzewijzer' and 'persoonlijke') in the center.

is it a bug or am i doing something wrong?

(issue imported from #M11310)


Files

gmenutje.gif (3.84 KB) gmenutje.gif Administrator Admin, 2009-06-09 16:27
gmenu-font.gif (5.05 KB) gmenu-font.gif Administrator Admin, 2009-06-10 10:06
bug_0011310.diff (1.96 KB) bug_0011310.diff Administrator Admin, 2010-04-09 13:55
11310_v2.diff (2.06 KB) 11310_v2.diff Administrator Admin, 2010-08-05 01:33
Actions #1

Updated by Oliver Hader almost 15 years ago

Please add the whole TypoScript that generates the mentioned image.
The breakSpace just defines a maximum width - however this has no absolute meaning that could be used to position an element centered or right aligned.

Actions #2

Updated by bilal almost 15 years ago

Hi Oliver,

this is the code...

temp.menu-level-1 < temp.menu-level-0
temp.menu-level-1.entryLevel = 1
temp.menu-level-1.1 = GMENU
temp.menu-level-1.1 {
NO.wrap = <li class="submenu"> | </li>
NO.stdWrap.htmlSpecialChars = 1
NO {
XY = 185,[10.h] + 10
backColor = #000000

10 = TEXT
10.text.field = title
10.fontFile = fileadmin/sitedesign/layouts/standaard/BlockBE-Condensed.otf
10.fontSize = 16
10.fontColor = #FFFFFF
10.align = center
10.offset = 0,17
10.breakWidth = 150
10.breakSpace = 1.2
}
ACT < .NO
ACT = 1
ACT.wrap = &lt;li class=&quot;submenu&quot;&gt;|&lt;/li&gt;
ACT.stdWrap.htmlSpecialChars = 1
ACT {
XY = 185,[10.h] + 10
10.backColor = #000000
10 = TEXT
10.text.field = title
10.fontFile = fileadmin/sitedesign/layouts/standaard/BlockBE-Condensed.otf
10.fontSize = 16
10.fontColor = #FFED00
10.align = center
10.offset = 0,17
10.breakWidth = 150
10.breakSpace = 1.2
}
}

regards,
bilal :-)

edit: this is the new gmenu, with the correct font, etc.
[img]http://img29.imageshack.us/img29/1809/gmenufont.gif[/img]

Actions #3

Updated by bilal almost 15 years ago

we're a couple of days further now...

is there someone out there who has a solution for this bug?

Actions #4

Updated by Wolfgang Hubbauer about 14 years ago

I encountered the same issue. The problem is that when using breakWidth in conjunction with align center/right, the x position where the text is drawn is not recalculated for each new line.

I added a patch to class.t3lib_stdgraphic.php, that extends the renderTTFText method, so that the x position is calculated individually for each new line, based upon the alignment.

It works perfectly for me, although integration into the stdGraphic lib probably could be more generic.
Regards,
Wolfgang

Actions #5

Updated by Jacob Floyd almost 14 years ago

Hmm. I just installed your patch. Awesome.
However, it creates an additional issue: offset and workArea don't seem to work with the fix. Here's my TS:

10 = IMAGE
10.file = GIFBUILDER
10.file {
format = gif
// quality = 100
XY = 900, 520
transparentBackground = true
backColor < globalMenu.1.NO.ATagParams.stdWrap.cObject.10.file.backColor
workArea = 401, 69, 363, 196
30 = TEXT
30 {
offset = 0,80
align = center
iterations = 3
niceText = 1
breakWidth = 300
fontSize = 55
fontFile = {$templavoila_framework.skinPath}/fonts/INKCALIG.TTF
fontColor < globalMenu.1.NO.ATagParams.stdWrap.cObject.10.file.20.fontColor
text.cObject = RECORDS
text.cObject {
tables = tt_content
conf.tt_content = TEXT
conf.tt_content.field = bodytext
source = tt_content_{$slogan.source}
}
}
}
10.wrap = <div id="home-brand">|</div>

Actions #6

Updated by Jacob Floyd almost 14 years ago

I included " + $x " in two lines (copies of the same line in two spots) of your patch and that fixes it for me:

$this->ImageTTFTextWrapper($im, $fontSize, $angle, ($conf['align'] 'right' ? $boundingBox[0] - $currentWidth + $x : ($conf['align'] 'center' ? ($boundingBox0 - $currentWidth) / 2 + $x : $x)), $y, $color, $fontFile, trim($phrase), $splitRendering, $sF);

I had to apply your patch manually because I'm using Typo3 v4.4 (beta), so let me know if you'd rather I do a diff file.

Actions #7

Updated by Jeff Segars over 13 years ago

Updated patch to apply against current trunk and included Jacob's suggestion. Works well in my very limited testing :)

Actions #8

Updated by Susanne Moog over 12 years ago

  • Status changed from Needs Feedback to Accepted
  • Target version deleted (0)
  • Complexity set to medium

Someone around who wants to push the patch to gerrit?

Actions #9

Updated by Alexander Opitz almost 11 years ago

  • Status changed from Accepted to Needs Feedback

The issue is very old, does this issue exists in newer versions of TYPO3 CMS (4.5 or 6.1)?

Actions #10

Updated by Alexander Opitz over 10 years ago

  • Status changed from Needs Feedback to Closed
  • Is Regression set to No

No feedback for over 90 days.

Actions

Also available in: Atom PDF