Skip to main content

Module glyph

Module glyph 

Source
Expand description

Glyph Protocol: application-defined vector glyphs over APC.

§Category

This module writes the four Glyph Protocol requests: support detection (s), coverage queries (q), registration (r), and clearing (c). Replies arrive as Event::Glyph.

§APC format

Every message is an APC string whose body starts with 25a1;:

ESC _ 25a1 ; <verb> [ ; key=value ]* [ ; <payload> ] ESC \

A registration carries its payload in the last field. Binary formats are base64; vg is printable ASCII text.

§Support detection

Send REQUEST_GLYPH_SUPPORT followed by Primary DA. A supporting terminal answers s before the Primary DA reply. Send q, r, and c only after a support reply. The uncurses-glyph crate provides a Probe and a Capabilities record for a composed capability batch.

§Registration block

Registrations target GLYPH_BLOCK, U+100000 through U+1003FF. A registered codepoint is an ordinary character: print it in a cell like any other text. A terminal can bind the glyph to text printed after the registration, or apply it to text already on screen. To change what is shown, register again and print the codepoint again.

See the protocol specification.

Structs§

GlyphRegistration
A registration request for one codepoint.

Enums§

GlyphPayload
A glyph payload, in one of the protocol’s formats.
GlyphReplies
Which replies a registration or clear request asks for.

Constants§

GLYPH_BLOCK
The codepoints that accept registrations: U+100000 through U+1003FF.
MAX_GLYPH_PAYLOAD
The largest payload a terminal accepts, in bytes: decoded for the binary formats, as sent for vg.
REQUEST_GLYPH_SUPPORT
Request supported payload formats and capabilities: ESC _ 25a1;s ESC \.

Functions§

write_glyph_clear
Write a clear request: ESC _ 25a1;c[;cp=<hex>][;reply=<n>] ESC \.
write_glyph_query
Write a coverage query for one codepoint: ESC _ 25a1;q;cp=<hex> ESC \.
write_glyph_query_grapheme
Write a coverage query for one grapheme cluster: ESC _ 25a1;q;grapheme=<hex>,<hex>,... ESC \.
write_glyph_register
Write a registration request.