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. --- apps/colors.mu | 4 ++-- apps/rpn.mu | 8 ++++---- 2 files changed, 6 insertions(+), 6 deletions(-) (limited to 'apps') 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 -- cgit 1.4.1-2-gfad0