7 Unicode placeholders
Unicode placeholders require graphics support and the terminal’s U=1 feature.
procedure
(kitty-place-unicode-image img rows columns [ #:placement-id placement-id #:force? force?]) → (or/c kitty-placement? #f) img : kitty-image? rows : exact-positive-integer? columns : exact-positive-integer? placement-id : (or/c exact-positive-integer? #f) = #f force? : boolean? = #f
Transmits img if needed and creates an invisible virtual placement
(a=p with U=1) sized rowsxcolumns. Returns that
placement, or #f when Unicode placeholders are unavailable and
force? is #f.
procedure
(put-kitty-unicode-placeholder-at row col img rows columns [ #:placement-id placement-id #:background background #:force? force?]) → boolean? row : exact-nonnegative-integer? col : exact-nonnegative-integer? img : kitty-image? rows : exact-positive-integer? columns : exact-positive-integer? placement-id : (or/c exact-positive-integer? #f) = #f background : (or/c #f byte? (list/c byte? byte? byte?)) = #f force? : boolean? = #f
Creates (or reuses) the matching virtual placement and writes a
rowsxcolumns block of placeholder cells starting at
rowxcol. background is #f (transparent), a
256-color index, or an (list r g b). Returns #t when output
was produced.
procedure
(format-kitty-unicode-placeholder image-id placement-id rows columns [ #:row row #:col col #:color-mode color-mode #:background background]) → bytes? image-id : exact-positive-integer? placement-id : (or/c exact-positive-integer? #f) rows : exact-positive-integer? columns : exact-positive-integer? row : (or/c exact-nonnegative-integer? #f) = #f col : (or/c exact-nonnegative-integer? #f) = #f color-mode : (or/c 'truecolor '256 '16) = 'truecolor background : (or/c #f byte? (list/c byte? byte? byte?)) = #f
Returns the SGR setup plus the placeholder text as bytes without writing them.
When row and col are given, each row is preceded by a cursor
move; when they are omitted, the caller is responsible for positioning. Color
mode limits which image/placement ids fit: 24 bits in truecolor, 8 bits in
256/16-color mode.
value
kitty-placeholder-char : string?
The Unicode placeholder character U+10EEEE.
procedure
(kitty-placeholder-diacritic n) → char?
n : exact-nonnegative-integer?
Returns the combining diacritic that encodes index n (0 to
296) in a placeholder cell.
(put-kitty-unicode-placeholder-at 5 10 img 2 3 #:placement-id 7 #:background #f) (kitty-place-unicode-image img 2 3 #:placement-id 7)
Placeholder cells use U+10EEEE. Row/column and the high image-id byte are encoded with combining diacritics; the image id is written as the foreground color and the placement id as the underline color. In truecolor mode the low 24 bits of the image id use RGB and the high byte uses a third diacritic; in 256/16-color mode ids are limited to 8 bits. rows and columns are limited to 297 by the diacritic table.