input|texttoimage( style )
Name | Type | Description | Required |
---|---|---|---|
style | string | The name of the style that should be used. | Yes. |
This operator creates an image that contains the input text rendered using a truetype font. The style parameter must be used to specify the desired style. If the style parameter is omitted, the default style will be used. The operator returns an "ezimagelayer" object which can be used as a parameter to the "image" operator. If this operator is called directly, eZ Publish will display the specified image using the "layer/image.tpl" template located in the "templates" directory of the current design or one of the fallback designs. It is possible to override this template using the template override system. Please note that this operator will only work if "ImageGD" is installed and enabled.
An eZ Publish distribution comes with a small collection of truetype fonts that are used by the default styles. These fonts are located in the "/design/standard/fonts" directory. The fonts included in this directory are free when it comes to costs and distribution. Information about the author of a font is placed in a directory with the same name as the font itself.
The default styles are defined in the "texttoimage.ini" configuration file. The following list reveals the names of the default styles.
Please refer to the examples below to see the default styles in action.
It is possible to create custom styles and to make use of custom fonts. For each style, it is possible to configure the following settings:
When using fonts that are located outside the "/design/standard/fonts" directory, for example "/design/example/fonts", the FontDir[] array in a configuration override for "texttoimage.ini" has to include an additional FontDir[] line that specifies the secondary font directory.
{'Another World'|texttoimage( '1942' )}
The following output will be produced:
Text rendered as image using the 1942 font.
{'Another World'|texttoimage( 'a_d_mono' )}
The following output will be produced:
Text rendered as image using the a_d_mono font.
{'Another World'|texttoimage( 'archtura' )}
The following output will be produced:
Text rendered as image using the archtura font.
{'Another World'|texttoimage( 'arial' )}
The following output will be produced:
Text rendered as image using the arial font.
{'Another World'|texttoimage( 'gallery' )}
The following output will be produced:
Text rendered as image using the gallery font.
{'Another World'|texttoimage( 'object_text' )}
The following output will be produced:
Text rendered as image using the object_text font.
{'Another World'|texttoimage( 'sketchy' )}
The following output will be produced:
Text rendered as image using the sketchy font.
{'Another World'|texttoimage( 'smartie' )}
The following output will be produced:
Text rendered as image using the smartie font.
{'Another World'|texttoimage()}
The following output will be produced (the default font will be used):
Text rendered as image using the a_d_mono font.
Powered by eZ Publish™ CMS Open Source Web Content Management. Copyright © 1999-2013 eZ Systems AS (except where otherwise noted). All rights reserved.