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§
- Glyph
Registration - A registration request for one codepoint.
Enums§
- Glyph
Payload - A glyph payload, in one of the protocol’s formats.
- Glyph
Replies - Which replies a registration or clear request asks for.
Constants§
- GLYPH_
BLOCK - The codepoints that accept registrations:
U+100000throughU+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.