Project

General

Profile

Bug #20603 » bug_0011310.diff

Administrator Admin, 2010-04-09 13:55

View differences:

t3lib.new/class.t3lib_stdgraphic.php 2010-04-09 13:26:59.000000000 +0200
$breakWidth = $conf['breakWidth'];
$breakSpace = $this->getBreakSpace($conf);
//Bounding box is needed for total image width
if ($conf['align'] == 'right' || $conf['align'] == 'center') {
$boundingBox = $this->calcBBox($conf);
}
$wordPairs = $this->getWordPairsForLineBreak($string);
// Iterate through all word pairs:
......
$currentWidth+= $wordWidth;
$phrase.= $wordPair;
} else {
// Render the current phrase that is below breakWidth:
$this->ImageTTFTextWrapper($im, $fontSize, $angle, $x, $y, $color, $fontFile, $phrase, $splitRendering, $sF);
//Recalc width to skip trailing blanks
$currentWidth = $this->getRenderedTextWidth(trim($phrase), $conf);
// Render the current phrase that is below breakWidth - set x position depending on alignment:
$this->ImageTTFTextWrapper($im, $fontSize, $angle, ($conf['align'] == 'right' ? $boundingBox[0] - $currentWidth : ($conf['align'] == 'center' ? ($boundingBox[0] - $currentWidth) / 2 : $x)), $y, $color, $fontFile, trim($phrase), $splitRendering, $sF);
// Calculate the news height offset:
$y+= $breakSpace;
// Restart the phrase:
......
}
// Render the remaining phrase:
if ($currentWidth) {
$this->ImageTTFTextWrapper($im, $fontSize, $angle, $x, $y, $color, $fontFile, $phrase, $splitRendering, $sF);
$this->ImageTTFTextWrapper($im, $fontSize, $angle, ($conf['align'] == 'right' ? $boundingBox[0] - $currentWidth : ($conf['align'] == 'center' ? ($boundingBox[0] - $currentWidth) / 2 : $x)), $y, $color, $fontFile, $phrase, $splitRendering, $sF);
}
} else {
$this->ImageTTFTextWrapper($im, $fontSize, $angle, $x, $y, $color, $fontFile, $string, $splitRendering, $sF);
(3-3/4)