You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
|`height`|`H' / lh`|`H' / lh`| Preserved | Default. Line-height drives. Horizontal extent is whatever `aw` scales to; may overflow the span. |
429
+
|`advance`|`W' / aw`|`W' / aw`| Preserved | Advance drives. Vertical extent is whatever `lh` scales to; may overflow. |
430
+
|`contain`|`min(W'/aw, H'/lh)`| same | Preserved | Outline fits entirely inside the span on both axes. May leave empty space on one axis. |
431
+
|`cover`|`max(W'/aw, H'/lh)`| same | Preserved | Outline fills the span on both axes. May overflow on one axis. |
432
+
|`stretch`|`W' / aw`|`H' / lh`| Not preserved | Each axis independent. Useful for box-drawing. |
433
+
434
+
`height` is the default because it matches how characters behave
435
+
(the terminal's line-height maps to the cell's vertical pixels,
436
+
the horizontal footprint is what the glyph's own advance dictates).
437
+
For icons that must stay inside the cell regardless of aspect,
438
+
prefer `contain`.
439
+
440
+
#### 8.5.4 Alignment
441
+
442
+
After scaling, the outline has a scaled authored extent `(aw×sx)
443
+
× (lh×sy)` positioned somewhere within the effective span. `align`
444
+
picks where.
445
+
446
+
Horizontal:
447
+
448
+
-`start` — outline's `x=0` aligns with the span's left edge
449
+
(`pad_left`).
450
+
-`center` — outline's horizontal midpoint aligns with the span's
451
+
horizontal midpoint.
452
+
-`end` — outline's `x=aw` aligns with the span's right edge
453
+
(`W − pad_right`).
454
+
455
+
Vertical (Y-up):
456
+
457
+
-`start` — outline's `y=y_min` aligns with the span's bottom edge
458
+
(`pad_bottom`).
459
+
-`center` — outline's vertical midpoint aligns with the span's
460
+
vertical midpoint.
461
+
-`end` — outline's `y=y_max` aligns with the span's top edge
462
+
(`H − pad_top`).
463
+
-`baseline` — outline's `y=0` aligns with the terminal's text
464
+
baseline within the cell. Preferred for character-like glyphs
465
+
that must sit on the same baseline as surrounding text;
466
+
descenders extend below the baseline naturally.
467
+
468
+
When `size=stretch`, the scaled extent exactly matches the span on
469
+
both axes, so `align` has no visible effect. When `size=cover`,
470
+
the scaled extent overflows on one axis; `align` picks which edge
471
+
to anchor (and therefore which overflow is visible vs. clipped).
472
+
When `size=contain`/`height`/`advance`, the scaled extent may be
473
+
smaller than the span on at least one axis; `align` picks where
474
+
the empty space goes.
475
+
476
+
#### 8.5.5 Resolution independence
363
477
364
-
The `upm` value defines the glyph's authoring coordinate space.
365
-
The terminal maps that space onto its cell at render time.
366
478
Applications MUST NOT assume a particular cell size and MUST NOT
367
-
re-register glyphs on font size change.
479
+
re-register glyphs on font size change. All scaling is computed
480
+
at render time from the parameters above and the terminal's
481
+
current cell metrics.
482
+
483
+
#### 8.5.6 Coordinated sets (no scale groups)
484
+
485
+
There is no `group` parameter. A set of glyphs that must visually
486
+
align — spinner frames, progress-bar steps, a multi-glyph logo —
487
+
aligns automatically if authored with identical `aw`, `lh`, `size`,
488
+
`align`, and `pad`, and if their outline geometry is coordinated
489
+
(e.g. all spinner frames sized inside a common bounding circle).
490
+
Scale-group semantics can be added later if authoring experience
491
+
shows they are genuinely needed; for v1 the burden sits with
492
+
the author, not the protocol.
368
493
369
494
### 8.6 Payload format: `colrv0`
370
495
@@ -539,7 +664,11 @@ A terminal emulator is Glyph Protocol v1 conformant if it:
539
664
color; renders `colrv0`/`colrv1` glyphs using the COLR paint
540
665
graph, resolving palette index `0xFFFF` to the current
541
666
foreground color.
542
-
7. Scales glyphs according to `upm` and the current cell size.
667
+
7. Scales and positions glyphs according to `upm`, `aw`, `lh`,
668
+
`width`, `size`, `align`, and `pad` as specified in §8.5, and
669
+
treats the registered codepoint as having the declared `width`
670
+
(`1` or `2`) for every layout decision, overriding the
671
+
codepoint's UAX #11 East Asian Width.
543
672
8. Enforces the cell-buffer authority invariant in §9: selection,
544
673
copy, and search return the raw codepoint.
545
674
9. Ignores unrecognized parameters rather than failing the
@@ -662,3 +791,4 @@ rather than serving a stale bitmap.
662
791
| 2026-04-19 | v1.4 | Raised the glossary capacity from 256 to 1024 simultaneous registrations per session, and raised the `n_glyphs` cap in `fmt=colrv0`/`colrv1` containers from 256 to 1024 outlines. Both bumps quadruple the worst-case memory footprint; the 64 KiB per-payload cap is unchanged. |
663
792
| 2026-04-21 | v1.5 | Added `cp=auto` to the `r` verb: the terminal allocates a free PUA codepoint (SHOULD come from PUA-B) and echoes it in the success reply so the client can emit it. Added `reason=auto_unsupported` and `reason=glossary_exhausted` error codes. `cp=auto` forces a success reply regardless of `reply=0|2` because the allocated codepoint is only carried in the reply. |
664
793
| 2026-04-23 | v1.6 | Removed `cp=auto` from the `r` verb (introduced in v1.5). Auto-allocation forced a stateful round-trip reply the client depended on to learn its codepoint, which recording tools like `asciinema` and `tee` cannot capture or replay — making `cp=auto` output impossible to reproduce from a transcript. Clients must pick their own PUA codepoint. The `auto_unsupported` and `glossary_exhausted` error codes are withdrawn. |
794
+
| 2026-04-23 | v1.7 | Added a sizing and placement model to the `r` verb: `aw` / `lh` (authored extent in upm units), `width` (Unicode/wcwidth width, `1` or `2`, authoritative), `size` (`height`/`advance`/`contain`/`cover`/`stretch`), `align` (`<h>,<v>` positioning after scale, with `v=baseline` for character-like glyphs), and `pad` (fractional insets from the render span). Pinned the coordinate convention: Y-up, `y=0` at baseline, `lh` measured descender-to-ascender (OpenType). Scale groups are intentionally omitted — coordinated sets align via matching parameters and outline geometry. |
0 commit comments