<text>

Renders its inner text content (whatever’s between <text> and </text>, after Jinja has expanded it) as a block of text.

<text x="10" y="10" size="40" font="home/Roboto-Bold.ttf" color="white">
    {{ timestamp.strftime('%A, %B %d') }}
</text>

Properties

The tag’s content (the text between <text> and </text>, after Jinja has expanded it) is the string drawn — it isn’t one of the attributes below. Whitespace from template indentation is included verbatim, since it’s just XML text content — keep tags tight around the text if stray leading/trailing whitespace or newlines would matter for width calculations.

pydantic model todays_paper_web.widgets.core.text.TextParams[source]

Bases: ViewParams

field align: str | None = None

Horizontal alignment (left/center/right), if given.

field color: Color [Optional]

Text color.

field font: str | None = None

Path to a .ttf/.otf font file, resolved the same way as any other file the config references. Falls back to the bundled FiraSans at size if unset or unloadable.

field size: int = 18

Font size in points.

field valign: str | None = None

Vertical alignment (top/middle/center/bottom), if given.

field width: int | None = None

If set, wraps text to this pixel width using greedy word-wrapping before measuring/drawing. Without it, only explicit newlines in the content break lines.

field x: int | None = None

Horizontal position, if given.

field y: int | None = None

Vertical position, if given.

color accepts a CSS color name or a #hex code; unlike most other widgets in this reference, an unrecognized color here raises a render error rather than silently falling back to black (see Python API reference).

Positioning

<text> doesn’t interpret x, y, align, or valign itself — those are read by whichever container it’s placed in (<box>, <row>, <column>) to decide where to put the rendered text block, as ViewParams above already shows. See Layout: box, column, row, screen for exactly how each container uses them.