pub struct TextShape {
pub at: Pos,
pub area: Size,
pub text: Text,
}Expand description
The block, its area’s top-left at at, each line centred in area.
The placement is the area’s, and the arithmetic is a signed subtraction truncated toward
zero. A zero area is an area of zero rather than a sentinel saying “start at at”: 0x0 puts
the offsets at -width/2 and -height/2, so the block sits around at and a box with no
interior still draws its text. Nothing is clipped to the area, so a block wider than the area it
was given overflows on both sides.
A complete shape in the sense of Complete and fragment: constructed, drawn and discarded. It writes one literal cell per glyph, an empty line writes nothing, and a line shorter than the area writes only its glyphs rather than spaces to fill it.
Fields§
§at: PosThe block’s area’s top-left, which is the point the offsets are measured from.
area: SizeThe area each line is centred in.
text: TextThe block itself.