From d253a3182859c7c989449122a60d5f362f19ded0 Mon Sep 17 00:00:00 2001 From: "Kartik K. Agaram" Date: Tue, 9 Nov 2021 08:12:11 -0800 Subject: rename grapheme to code-point-utf8 Longer name, but it doesn't lie. We have no data structure right now for combining multiple code points. And it makes no sense for the notion of a grapheme to conflate its Unicode encoding. --- 501draw-text.mu | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to '501draw-text.mu') diff --git a/501draw-text.mu b/501draw-text.mu index 5d2917a9..66260b56 100644 --- a/501draw-text.mu +++ b/501draw-text.mu @@ -117,7 +117,7 @@ fn draw-text-rightward screen: (addr screen), text: (addr array byte), x: int, x fn draw-stream-rightward screen: (addr screen), stream: (addr stream byte), x: int, xmax: int, y: int, color: int, background-color: int -> _/eax: int { var xcurr/ecx: int <- copy x { - var g/eax: grapheme <- read-grapheme stream + var g/eax: code-point-utf8 <- read-code-point-utf8 stream compare g, 0xffffffff/end-of-file break-if-= var c/eax: code-point <- to-code-point g @@ -218,7 +218,7 @@ fn draw-stream-wrapping-right-then-down screen: (addr screen), stream: (addr str next-c <- copy 0 break $draw-stream-wrapping-right-then-down:read-base } - var g/eax: grapheme <- read-grapheme stream + var g/eax: code-point-utf8 <- read-code-point-utf8 stream var _c/eax: code-point <- to-code-point g c <- copy _c } @@ -240,7 +240,7 @@ fn draw-stream-wrapping-right-then-down screen: (addr screen), stream: (addr str compare done?, 0/false break-if-!= # read a character - var g/eax: grapheme <- read-grapheme stream + var g/eax: code-point-utf8 <- read-code-point-utf8 stream var c/eax: code-point <- to-code-point g # if not a combining character, save for next iteration and loop { @@ -343,7 +343,7 @@ fn draw-int32-hex-wrapping-right-then-down screen: (addr screen), n: int, xmin: var xcurr/edx: int <- copy x var ycurr/ecx: int <- copy y { - var g/eax: grapheme <- read-grapheme stream + var g/eax: code-point-utf8 <- read-code-point-utf8 stream compare g, 0xffffffff/end-of-file break-if-= var c/eax: code-point <- to-code-point g @@ -398,7 +398,7 @@ fn draw-int32-decimal-wrapping-right-then-down screen: (addr screen), n: int, xm var xcurr/edx: int <- copy x var ycurr/ecx: int <- copy y { - var g/eax: grapheme <- read-grapheme stream + var g/eax: code-point-utf8 <- read-code-point-utf8 stream compare g, 0xffffffff/end-of-file break-if-= var c/eax: code-point <- to-code-point g @@ -466,7 +466,7 @@ fn draw-text-downward screen: (addr screen), text: (addr array byte), x: int, y: fn draw-stream-downward screen: (addr screen), stream: (addr stream byte), x: int, y: int, ymax: int, color: int, background-color: int -> _/eax: int { var ycurr/ecx: int <- copy y { - var g/eax: grapheme <- read-grapheme stream + var g/eax: code-point-utf8 <- read-code-point-utf8 stream compare g, 0xffffffff/end-of-file break-if-= var c/eax: code-point <- to-code-point g @@ -508,7 +508,7 @@ fn draw-stream-wrapping-down-then-right screen: (addr screen), stream: (addr str var xcurr/edx: int <- copy x var ycurr/ecx: int <- copy y { - var g/eax: grapheme <- read-grapheme stream + var g/eax: code-point-utf8 <- read-code-point-utf8 stream compare g, 0xffffffff/end-of-file break-if-= var c/eax: code-point <- to-code-point g -- cgit 1.4.1-2-gfad0