ez.no / exponential / documentation / reference / template operators / images / texttoimage
$input_string|texttoimage( style )
| Name | Type | Description | Required |
|---|---|---|---|
| style | string | Name of style to use. | Yes. |
Image layer.
This operator creates an image that contains the text which was specified using the input parameter. The text is rendered using a truetype font. The style parameter must specify the name of the style that the operator should use when rendering the text. If the style doesn't exist or the parameter is omitted (although it is required), the default style will be used.
The various style settings are set up in the "texttoimage.ini" configuration file. Each style is simply just a block of settings. For each style it it possible to specify the following:
The configuration file comes with a couple of basic styles. It is possible to create custom styles. The configuration file also specifies the location where Exponential should look for the truetype font files. An Exponential distribution comes with a small collection of truetype fonts ready for use. 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 regarding the author and other things can be found within the text file that is placed in a directory with the same name as the font itself.
When using fonts that are located outside the "/design/standard/fonts" directory, for example "/design/my_company/fonts", the FontDir[] array within the "texttoimage.ini" file (or an override) has to include an additional FontDir[] line that specifies this directory.
This operator creates and returns an image object. The operator basically flattens/merges the image layers that were provided using the parameters. However, a parameter can be something else than an image layer. A parameter to this operator can be one of three things:
If a parameter is a string, the text will be used as the alternative image text for the image object that is returned by the operator.
If a parameter is an image layer then the layer will simply be merged into the image object that is to be returned by the operator.
If a parameter is an array, the operator will assume that the first array element (element zero) is the image itself (an image layer created by either the imagefile or the texttoimage operator), and that the second element is a hash (associative array) containing parameters for that layer. The following parameters can be used:
The x and xrel parameters can not be used at the same time. The same goes for the y and the yrel parameters.
When right or bottom alignment is used, the coordinate system will shift to accommodate the alignment. This is useful for doing alignment and placement since the placement is relative to the current coordinate system. Right alignment will start the axis at the right (0) and go on to the left (width).
Bottom alignment will start the axis at the bottom (0) and go on to the top (height).
If the operator is called directly, the "/design/standard/templates/image/imageobject.tpl" template will be used to display the image object that is returned by the operator. It is possible to override this template using the template override system.
Images created with this operator will be cached inside the "cache/texttoimage" folder, within the var-directory that is used for the siteaccess.
{'Exponential'|texttoimage( 'sketchy' )}
This will render the string "Exponential" using the truetype font, size, rotation, etc. that is defined in the sketchy style.
Comments