Text rendering options
Text rendering layer (fnt)
Text rendering is a compound command that allows to set up multiple parameters related to text rendering at the same time.
The command format: txt=var1:value1;var2:value2;... — a semi-colon separated list of variables and their respective values.
Variable | Type of value | Description |
|---|---|---|
|
| Font file name. The font file shall be available in the image server client storage area |
|
| Font size |
|
| Enable or disable faux bold font rendering. In most cases, it is recommended to use a font file version that matches the desired font attributes, such as bold or italic. However, if such version is not available, faux rendering can provide a close alternative. |
|
| Enable or disable italic font |
|
| Text color |
|
| Render text vertically. Vertical text rendering displays font glyphs using the conventional orientation but arranges them vertically. This is different from simply rotating the text by 90°. |
| Supported values:
| Horizontal alignment, respectively:
|
| Supported values:
| Vertical alignment, respectively:
|
|
| Line height, multiplier of font size. For example:
Only one of |
|
| Line height, absolute value. For example:
|
|
| Minimum line height. Used when text auto-sizing is enabled along with the dynamic line height. Prevents lines from being compressed too close to each other. |
|
| Vertical spacing between characters when vertical text rendering is enabled, multiplier of font size. This is distinct from line height used for horizontal text rendering. |
|
| Vertical line spacing when using |
Text (txt)
txt command specifies the text to be rendered in the text layer.
In the basic form, the parameter value specifies the text be rendered as-is, for example txt=Hello. The parameter
Escaping characters
In addition to usual precautions such as percent encoding non-URI-safe characters, the text string can contain following escape sequences. Some characters shall always be escaped as following:
\\→\\{→{\s→(space)\n→ new line character
Text runs
Text to be rendered can also contain embedded text runs that have different from the main text body by one or more attributes.
Text runs shall start with a {{...}} sequence and terminate with {{/}}, such as: {{command}}text{{/}}.
The command sequence follows the usual pattern of variables and parameter values. The command sequence shall be a comma-separated list of variable names and values, each separated by : character, for example:var1:value1;var2:value2,...
If text within a run contains a { character, it shall be escaped as \{.
Run command support following parameters:
Variable | Type of value | Description |
|---|---|---|
|
| Font file name. The font file shall be available in the image server client storage area |
|
| Font size. |
|
| Font size multiplier, relative to the main text font size. For example |
|
| Text color |
|
| Offset text vertically by the specified number of pixels |
| Supported values:
| Vertical alignment, respectively:
|