From 6e05a8fa27139ddf75a029ad94d44b48a92785b2 Mon Sep 17 00:00:00 2001 From: "Kartik K. Agaram" Date: Sun, 29 Aug 2021 22:16:34 -0700 Subject: fix bad terminology: grapheme -> code point Unix text-mode terminals transparently support utf-8 these days, and so I treat utf-8 sequences (which I call graphemes in Mu) as fundamental. I then blindly carried over this state of affairs to bare-metal Mu, where it makes no sense. If you don't have a terminal handling font-rendering for you, fonts are most often indexed by code points and not utf-8 sequences. --- shell/primitives.mu | 2 +- shell/sandbox.mu | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) (limited to 'shell') diff --git a/shell/primitives.mu b/shell/primitives.mu index d38eedbc..e955b531 100644 --- a/shell/primitives.mu +++ b/shell/primitives.mu @@ -3493,7 +3493,7 @@ fn apply-blit _args-ah: (addr handle cell), out: (addr handle cell), trace: (add var dest-ah/eax: (addr handle screen) <- get second, screen-data var dest/eax: (addr screen) <- lookup *dest-ah # - convert-graphemes-to-pixels src + convert-screen-cells-to-pixels src copy-pixels src, dest } diff --git a/shell/sandbox.mu b/shell/sandbox.mu index eb752b14..d50f47f0 100644 --- a/shell/sandbox.mu +++ b/shell/sandbox.mu @@ -255,8 +255,8 @@ fn render-empty-screen screen: (addr screen), _target-screen: (addr screen), xmi fn render-screen screen: (addr screen), _target-screen: (addr screen), xmin: int, ymin: int { var target-screen/esi: (addr screen) <- copy _target-screen - convert-graphemes-to-pixels target-screen # might overwrite existing pixel data with graphemes - # overlapping the two is not supported + convert-screen-cells-to-pixels target-screen # might overwrite existing pixel data with screen cells + # overlapping the two is not supported # pixel data { # screen top left pixels x y width height @@ -383,10 +383,10 @@ fn print-screen-cell-of-fake-screen screen: (addr screen), _target: (addr screen var index/ecx: int <- screen-cell-index target, x, y var offset/ecx: (offset screen-cell) <- compute-offset data, index var src-cell/esi: (addr screen-cell) <- index data, offset - var src-grapheme/eax: (addr grapheme) <- get src-cell, data + var src-code-point/eax: (addr code-point) <- get src-cell, data var src-color/ecx: (addr int) <- get src-cell, color var src-background-color/edx: (addr int) <- get src-cell, background-color - draw-grapheme-at-cursor-over-full-screen screen, *src-grapheme, *src-color, *src-background-color + draw-code-point-at-cursor-over-full-screen screen, *src-code-point, *src-color, *src-background-color } fn render-sandbox-edit-menu screen: (addr screen), _self: (addr sandbox) { -- cgit 1.4.1-2-gfad0 be53a6e17dcc2dbf3e6f3d430ab685ac3b (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240