Skip to main content
Skip table of contents

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

f

string

Font file name. The font file shall be available in the image server client storage area

s

number

Font size

b

boolean

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.

i

boolean

Enable or disable italic font

c

Color string

Text color

v

boolean

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°.

a

Supported values:

  • s

  • c

  • e

Horizontal alignment, respectively:

  • Start (left for LTR languages)

  • Center

  • End (right for LTR languages)

va

Supported values:

  • s

  • c

  • e

Vertical alignment, respectively:

  • Top

  • Center

  • Bottom

lh

number

Line height, multiplier of font size. For example:

  • 1

  • 1.5

Only one of lh and lha values should be specified.

lha

number

Line height, absolute value. For example:

  • 20

  • 32

lhm

number

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.

sv

number

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.

sl

number

Vertical line spacing when using tight text layouts combined with vertical text rendering. See Text rendering layouts for more details.

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

f

string

Font file name. The font file shall be available in the image server client storage area

s

number

Font size.

sr

number

Font size multiplier, relative to the main text font size. For example sr:0.5

c

Color string

Text color

y

number

Offset text vertically by the specified number of pixels

va

Supported values:

  • baseline

  • top

  • middle

Vertical alignment, respectively:

  • Baseline

  • Top

  • Middle

JavaScript errors detected

Please note, these errors can depend on your browser setup.

If this problem persists, please contact our support.