about summary refs log tree commit diff stats
path: root/apps
diff options
context:
space:
mode:
authorKartik K. Agaram <vc@akkartik.com>2021-08-29 22:16:34 -0700
committerKartik K. Agaram <vc@akkartik.com>2021-08-29 22:20:09 -0700
commit6e05a8fa27139ddf75a029ad94d44b48a92785b2 (patch)
tree8d04ae5d057030246305c9dc4b46fb2fe176f643 /apps
parent4b90a26d71513f3b908b7f7ec651996ddf6460d6 (diff)
downloadmu-6e05a8fa27139ddf75a029ad94d44b48a92785b2.tar.gz
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.
Diffstat (limited to 'apps')
-rw-r--r--apps/colors.mu4
-rw-r--r--apps/rpn.mu8
2 files changed, 6 insertions, 6 deletions
diff --git a/apps/colors.mu b/apps/colors.mu
index c58fec35..3d9f1bc1 100644
--- a/apps/colors.mu
+++ b/apps/colors.mu
@@ -27,8 +27,8 @@ fn main screen: (addr screen), keyboard: (addr keyboard), data-disk: (addr disk)
       loop-if-=
       var key2/eax: int <- copy key
       append-byte in, key2
-      var g/eax: grapheme <- copy key2
-      draw-grapheme-at-cursor-over-full-screen screen, g, 0xf/fg, 0/bg
+      var c/eax: code-point <- copy key2  # TODO: unicode input
+      draw-code-point-at-cursor-over-full-screen screen, c, 0xf/fg, 0/bg
       loop
     }
     clear-screen screen
diff --git a/apps/rpn.mu b/apps/rpn.mu
index ac54457d..4fd8ccb6 100644
--- a/apps/rpn.mu
+++ b/apps/rpn.mu
@@ -19,7 +19,7 @@ fn main screen: (addr screen), keyboard: (addr keyboard), data-disk: (addr disk)
   var in-storage: (stream byte 0x80)
   var in/esi: (addr stream byte) <- address in-storage
   var y/ecx: int <- copy 0
-  var space/edx: grapheme <- copy 0x20
+  var space/edx: code-point <- copy 0x20
   # read-eval-print loop
   {
     # print prompt
@@ -35,12 +35,12 @@ fn main screen: (addr screen), keyboard: (addr keyboard), data-disk: (addr disk)
       loop-if-=
       var key2/eax: int <- copy key
       append-byte in, key2
-      var g/eax: grapheme <- copy key2
-      draw-grapheme-at-cursor-over-full-screen screen, g, 0xf/fg, 0/bg
+      var c/eax: code-point <- copy key2
+      draw-code-point-at-cursor-over-full-screen screen, c, 0xf/fg, 0/bg
       loop
     }
     # clear cursor
-    draw-grapheme-at-cursor-over-full-screen screen, space, 3/fg/never-used, 0/bg
+    draw-code-point-at-cursor-over-full-screen screen, space, 3/fg/never-used, 0/bg
     # parse and eval
     var out/eax: int <- simplify in
     # print