drawText

suspend fun drawText(text: String, config: JsonObject)

Draws text.

If text is wider than the limit given by max_width parameter, text is truncated and ellipses added.

Effects and the following additional drawing parameters are supported:

  • font - name of the font file from the resources or a list of names, when a list of names is given, each following font must be more condensed than the previous one. If text does not fit in the maximum width given, the next font is tried before truncating the text

  • font_size - height of the font (60 by default)

  • max_width - maximum text width (not limited by default)

Parameters

text

text to draw

config

parameters to draw the text