Note on (+calc)

Whenever the +calc function is added to a value in the data type of the properties underneath, you can use the dimensions of TEXT and IMAGE objects from the GIFBUILDER object array. This is done by inserting a tag like this: [10.w] or [10.h], where 10 is the GIFBUILDER object number in the array and w/h signifies either width or height of the object.

The special property lineHeight (for example, [10.lineHeight]) uses the height a single line of text would take.

On using the special function max(), the maximum of multiple values can be determined. Example:

EXT:site_package/Configuration/TypoScript/setup.typoscript
XY = [10.w]+[20.w], max([10.h], [20.h])
Copied!

Here is a full example:

EXT:site_package/Configuration/TypoScript/setup.typoscript
lib.example = IMAGE
lib.example {
  file = GIFBUILDER
  file {
  XY = [10.w]+20, [10.h]+20
  backColor = #ff8700
  format = png

  10 = TEXT
  10 {
    text = TYPO3 GIFBUILDER Example
    fontSize = 20
    fontColor = #ffffff
    offset = 10,25
  }
}
Copied!

As you see, the image has a width/height defined as the width/height of the text printed onto it + 20 pixels.

The generated image looks like:

TYPO3 GIFBUILDER Example

The rendered image from the example above