Skip to content

Commit 649cfb1

Browse files
authored
Merge pull request directvt#714 from o-sdn-o/gui-bridge
Allow to output 16x4 characters
2 parents e8f6e59 + 698119b commit 649cfb1

11 files changed

+9075
-435
lines changed

doc/character_geometry.md

+23-14
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,9 @@ By defining that the graphical representation of a character is a cellular matri
1717

1818
1x1 | 2x2 | 3x1
1919
----|-----|-----
20-
![SGR-CFA-A](https://github.com/directvt/vtm/assets/11535558/9eba4601-6bab-4498-8f89-2aee70b59b38) | ![SGR-CFA-E](https://github.com/directvt/vtm/assets/11535558/77c73079-8ea2-43f3-a5a8-2c2ec3adc5ec) | ![SGR-CFA-Indic](https://github.com/directvt/vtm/assets/11535558/f646cc6d-7d01-409a-a8eb-53c42536fdab)
20+
![SGR-CFA-A](images/A_1x1.png) | ![SGR-CFA-E](images/E_2x2.png) | ![SGR-CFA-Indic](images/deva_3x1.png)
2121

22-
Each character is a sequence of codepoints (one or more) - this is the so-called grapheme cluster. Using a font, this sequence is translated into a glyph run. The final scaling and rasterization of the glyph run is done into a rectangular terminal cell matrix, defined either implicitly based on the Unicode properties of the cluster codepoints, or explicitly using a modifier codepoint from the Unicode codepoint range 0xD0000-0xD02A2.
22+
Each character is a sequence of codepoints (one or more) - this is the so-called grapheme cluster. Using a font, this sequence is translated into a glyph run. The final scaling and rasterization of the glyph run is done into a rectangular terminal cell matrix, defined either implicitly based on the Unicode properties of the cluster codepoints, or explicitly using a modifier codepoint from the Unicode codepoint range 0xD0000-0xD08F6.
2323

2424
Matrix fragments up to 16x4 cells require at least four associated integer values, which can be packed into Unicode codepoint space by enumerating "wh_xy" values:
2525
- w: Character matrix width.
@@ -28,34 +28,43 @@ Matrix fragments up to 16x4 cells require at least four associated integer value
2828
- y: Vertical fragment selector inside the matrix.
2929
- For character matrices larger than 16x4, pixel graphics should be used.
3030

31-
### //todo geometry modifier table
31+
[Table source](images/vtm_character_geometry_modifiers_16x4.xhtml)
32+
33+
![image](images/vtm_character_geometry_modifiers_16x4.png)
3234

3335
Terminals can annotate each scrollback cell with character matrix metadata and use it to display either the entire character image or a specific fragment within the cell.
3436

3537
Users can explicitly specify the size of the character matrix (by zeroing `_xy`) or select any fragment of it (non-zero `_xy`) by placing a specific modifier character after the grapheme cluster.
3638

37-
### //todo geometry modifiers are outdated since v0.9.99.67
38-
39-
- Example 1. Output a 3x1 character:
39+
- Example 1. Output a 3x1 (31_00) character:
40+
- `pwsh`
41+
```pwsh
42+
"👩‍👩‍👧‍👧`u{D009F}"
43+
```
44+
- `wsl/bash`
45+
```bash
46+
printf "👩‍👩‍👧‍👧\UD009F\n"
47+
```
48+
- Example 2. Output a 6x2 character (by stacking two 6x1 fragments 62_01 and 62_02 on top of each other):
4049
- `pwsh`
4150
```pwsh
42-
"👩‍👩‍👧‍👧`u{D0033}"
51+
"👩‍👩‍👧‍👧`u{D0279}`n👩‍👩‍👧‍👧`u{D0312}"
4352
```
4453
- `wsl/bash`
4554
```bash
46-
printf "👩‍👩‍👧‍👧\UD0033\n"
55+
printf "👩‍👩‍👧‍👧\UD0279\n👩‍👩‍👧‍👧\UD0312\n"
4756
```
48-
- Example 2. Output a 6x2 character (by stacking two 6x1 fragments on top of each other due to the linear nature of the terminal):
57+
- Example 3. Output the longest word in the Hindi language 16x1 (G1_00):
4958
- `pwsh`
5059
```pwsh
51-
"👩‍👩‍👧‍👧`u{D00C9}`n👩‍👩‍👧‍👧`u{D00F6}"
60+
"`u{2}विश्वविज्ञानकोशनिर्माणसमिति`u{D0121}"
5261
```
5362
- `wsl/bash`
5463
```bash
55-
printf "👩‍👩‍👧‍👧\UD00C9\n👩‍👩‍👧‍👧\UD00F6\n"
64+
printf "\U2विश्वविज्ञानकोशनिर्माणसमिति\UD0121\n"
5665
```
5766
- Screenshot:
58-
![image](https://github.com/user-attachments/assets/5c6d0e5c-ba36-4602-a626-95f64042c67f)
67+
![image](images/vtm_character_geometry_modifiers_screenshot.png)
5968
6069
### Helper functions
6170
@@ -103,7 +112,7 @@ To set arbitrary boundaries, the C0 control character `ASCII 0x02 STX` is used,
103112

104113
## Another brick in the wall
105114

106-
> At present only standardized variation sequences with VS1, VS2, VS3, VS15 and VS16 have been defined; VS15 and VS16 are reserved to request that a character should be displayed as text or as an emoji) respectively.
115+
> At present only standardized variation sequences with VS1, VS2, VS3, VS15 and VS16 have been defined; VS15 and VS16 are reserved to request that a character should be displayed as text or as an emoji respectively.
107116
108117
> VS4–VS14 (U+FE03–U+FE0D) are not used for any variation sequences
109118
@@ -152,4 +161,4 @@ int get_hflip(int state) { int hflip = state >> 2; return hflip; }
152161
153162
# Summary
154163
155-
![image](https://github.com/user-attachments/assets/4f9f7450-a49c-43db-8001-e8be4530450e)
164+
![image](images/vtm_character_geometry_modifiers_summary.png)

doc/images/A_1x1.png

1021 Bytes
Loading

doc/images/E_2x2.png

1.25 KB
Loading

doc/images/deva_3x1.png

2.48 KB
Loading
Loading

0 commit comments

Comments
 (0)