CardCanvas
The drawing surface handed to a CardFace: plain Compose drawing (scope) plus text helpers, so faces can lay out text without platform code. Sizes are in card pixels (1024×646).
Every helper comes in two forms that draw identically: one with Compose types (Color, TextStyle, TextUnit; Kotlin only) and one with plain values — colours as ARGB Longs (0xAARRGGBB, see CardColors), text sizes as Floats and weights as CardTextWeight — which is the one Swift sees.
Properties
Functions
background with ARGB colours and the default guilloche lines.
A soft diagonal gradient over the whole card plus fine guilloche lines.
background with ARGB colours (0xAARRGGBB), lines included.
field at the default size (26) and colours.
A small uppercase-style label with its value below ("—" when missing).
radialBackground with ARGB colours and the default white print.
A radial gradient (center colour in the middle radiating to edge) plus a fine woven print: two diagonal line sets and a lattice of small rings, all in pattern. The security-print look of many national ID cards.
radialBackground with ARGB colours (0xAARRGGBB), pattern included.
textCenter without letter spacing.
Text centred on centerX (see textCenter); size, weight, color and letterSpacing as in text.
Text right-aligned to rightX: laid out in a fixed box spanning 0..rightX with absolute right alignment rather than offset by a measured width (see the note on constraints below).
textRight without letter spacing.
The width text takes at size and weight (with letterSpacing), for inline label + value pairs.