I noticed this too. Make it possible to add arbitrary content in `curve`/`polygon` shape · Issue #6397 · typst/typst · GitHub
#let shape(side, fill: none, stroke: 1pt, ..body) = {
set curve.line(relative: true)
place(curve(
stroke: stroke,
fill: fill,
curve.line((side, 0pt)),
curve.line((0pt, side)),
curve.line((-side, 0pt)),
curve.line((0pt, -side)),
))
block(width: side, height: side, ..body)
}
#shape(1cm, align(center + horizon)[text])
