TEXT

Renders a text.

Properties

align

align
Data type

align / stdWrap

Default

left

The alignment of the text.

Possible values:

  • left

  • center

  • right

angle

angle
Data type

degree

Default

0

Range

-90 to 90

The rotation degree of the text.

Note

The angle is not available, if spacing / wordSpacing is set.

antiAlias

antiAlias
Data type

boolean

Default

1 (true)

The FreeType antialiasing.

Note

This option is not available, if niceText is enabled.

Setting this option to 0 will not work, if fontColor is set to black (or #000000).

breakSpace

breakSpace
Data type

float

Default

1.0

Defines a value that is multiplied by the line height of the current element.

breakWidth

breakWidth
Data type

integer / stdWrap

Defines the maximum width for an object, overlapping elements will force an automatic line break.

doNotStripHTML

doNotStripHTML
Data type

boolean

Default

0 (false)

If set, HTML tags inserted in the text are not removed. Any other HTML code will be removed by default!

emboss

emboss
Data type

GIFBUILDER object ->EMBOSS

fontColor

fontColor
Data type

GraphicColor / stdWrap

Default

black

The font color.

fontFile

fontFile
Data type

resource / stdWrap

Default

Nimbus (Arial clone)

The font face (TrueType *.ttf and OpenType *.otf fonts can be used).

fontSize

fontSize
Data type

positive integer / stdWrap

Default

12

The font size.

hide

hide
Data type

boolean / stdWrap

Default

0 (false)

If this is true, the text is not printed.

This feature may be used, if you need a SHADOW object to base a shadow on the text, but do not want the text to be displayed.

iterations

iterations
Data type

positive integer / stdWrap

Default

1

How many times the text should be "printed" onto it self. This will add the effect of bold text.

Note

This option is not available, if niceText is enabled.

maxWidth

maxWidth
Data type

positive integer / stdWrap

Sets the maximum width in pixels, the text must be. Reduces the fontSize, if the text does not fit within this width.

Does not support setting alternative font sizes in splitRendering options.

niceText

niceText
Data type

boolean / stdWrap

This is a very popular feature that helps to render small letters much nicer than the FreeType library can normally do. But it also loads the system very much!

The principle of this function is to create a black/white image file in twice or more times the size of the actual image file and then print the text onto this in a scaled dimension. Afterwards GraphicsMagick/ImageMagick scales down the mask and masks the fontColor down on the original image file through the temporary mask.

The fact that the font is actually rendered in the double size and scaled down adds a more homogeneous shape to the letters. Some fonts are more critical than others though. If you do not need the quality, then do not use the function.

after

niceText.after

GraphicsMagick/ImageMagick parameters after scale.

before

niceText.before

GraphicsMagick/ImageMagick parameters before scale.

scaleFactor

niceText.scaleFactor
Data type

integer (2-5)

The scaling factor.

sharpen

niceText.sharpen
Data type

integer (0-99)

The sharpen value for the mask (after scaling). This enables you to make the text crisper, if it is too blurred!

offset

offset
Data type

x,y +calc / stdWrap

Default

0,0

The offset of the text.

outline

outline
Data type

GIFBUILDER object ->OUTLINE

shadow

shadow
Data type

GIFBUILDER object ->SHADOW

spacing

spacing
Data type

positive integer / stdWrap

Default

0

The pixel distance between letters. This may render ugly!

splitRendering

splitRendering
Data type

integer / (array of keys)

Split the rendering of a string into separate processes with individual configurations. By this method a certain range of characters can be rendered with another font face or size. This is very useful if you want to use separate fonts for strings where you have latin characters combined with, for example, Japanese and there is a separate font file for each.

You can also render keywords in another font / size / color.

[array]

splitRendering.[array]
Data type

integer

With keyword being [charRange, highlightWord].

  • splitRendering.[array] = keyword with keyword being [charRange, highlightWord]

  • splitRendering.[array] {

    • fontFile: Alternative font file for this rendering.

    • fontSize: Alternative font size for this rendering.

    • color: Alternative color for this rendering, works only without niceText.

    • xSpaceBefore: x space before this part.

    • xSpaceAfter: x space after this part.

    • ySpaceBefore: y space before this part.

    • ySpaceAfter: y space after this part.

    }

Keyword: charRange

splitRendering.[array].value = Comma-separated list of character ranges (for example, 100-200) given as Unicode character numbers. The list accepts optional starting and ending points, for example, - 200 or 200 - and single values, for example, 65, 66, 67.

Keyword: highlightWord

splitRendering.[array].value = Word to highlight, makes a case sensitive search for this.

Limitations:

  • The pixel compensation values are not corrected for scale factor used with niceText. Basically this means that when niceText is used, these values will have only the half effect.

  • When word spacing is used the highlightWord mode does not work.

  • The color override works only without niceText.

Example:

EXT:site_package/Configuration/TypoScript/setup.typoscript
10.splitRendering.compX = 2
10.splitRendering.compY = -2
10.splitRendering.10 = charRange
10.splitRendering.10 {
  value = 200-380 , 65, 66
  fontSize = 50
  fontFile = EXT:core/Resources/Private/Font/nimbus.ttf
  xSpaceBefore = 30
}
10.splitRendering.20 = highlightWord
10.splitRendering.20 {
  value = TheWord
  color = red
}

compX

splitRendering.compX
Data type

integer

Additional pixel space between parts, x direction.

compY

splitRendering.compY
Data type

integer

Additional pixel space between parts, y direction.

text

text
Data type

string / stdWrap

This is text on the image file. The item is rendered only, if this string is not empty.

The $cObj->data array is loaded with the page record, if, for example, the GIFBUILDER object is used in TypoScript.

textMaxLength

textMaxLength
Data type

integer

Default

100

The maximum length of the text. This is just a natural break that prevents incidental rendering of very long texts!

wordSpacing

wordSpacing
Data type

positive integer / stdWrap

Default

spacing * 2

The pixel distance between words.