diff options
author | Kartik K. Agaram <vc@akkartik.com> | 2021-11-09 08:12:11 -0800 |
---|---|---|
committer | Kartik K. Agaram <vc@akkartik.com> | 2021-11-09 08:12:11 -0800 |
commit | d253a3182859c7c989449122a60d5f362f19ded0 (patch) | |
tree | 7459cddc57f93107fa4cee89d4f0a94dd0f0f131 /apps | |
parent | d1808995b2c6b99749237a29e6ac6477d00ff8f9 (diff) | |
download | mu-d253a3182859c7c989449122a60d5f362f19ded0.tar.gz |
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.
Diffstat (limited to 'apps')
-rw-r--r-- | apps/ex15.mu | 80 | ||||
-rw-r--r-- | apps/ex9.mu | 2 | ||||
-rw-r--r-- | apps/hest-life.mu | 4 |
3 files changed, 43 insertions, 43 deletions
diff --git a/apps/ex15.mu b/apps/ex15.mu index 51bfc1db..570704d6 100644 --- a/apps/ex15.mu +++ b/apps/ex15.mu @@ -32,13 +32,13 @@ fn main screen: (addr screen), keyboard: (addr keyboard), data-disk: (addr disk) var dummy/eax: int <- draw-code-point-on-real-screen 0x61/a, 0/x 0/y, 3/fg 0/bg var dummy/eax: int <- overlay-code-point-on-real-screen 0x0300/combining-grave-accent, 0/x 0/y, 3/fg 0/bg - # below a grapheme with a descender, the accent uglily overlaps + # below a code-point-utf8 with a descender, the accent uglily overlaps # https://en.wikipedia.org/wiki/Descender var dummy/eax: int <- draw-code-point-on-real-screen 0x67/g, 4/x 3/y, 3/fg 0/bg var dummy/eax: int <- draw-code-point-on-real-screen 0x61/a, 4/x 4/y, 3/fg 0/bg var dummy/eax: int <- overlay-code-point-on-real-screen 0x0300/combining-grave-accent, 4/x 4/y, 3/fg 0/bg - # beside a grapheme with a descender, it becomes more obvious that monowidth fonts can't make baselines line up + # beside a code-point-utf8 with a descender, it becomes more obvious that monowidth fonts can't make baselines line up # https://en.wikipedia.org/wiki/Baseline_(typography) var dummy/eax: int <- draw-code-point-on-real-screen 0x67/g, 8/x 3/y, 3/fg 0/bg var dummy/eax: int <- draw-code-point-on-real-screen 0x61/a, 9/x 3/y, 3/fg 0/bg @@ -82,62 +82,62 @@ fn main screen: (addr screen), keyboard: (addr keyboard), data-disk: (addr disk) var dummy/eax: int <- draw-code-point-on-real-screen 0x0915/devanagari-letter-ka, 0x13/x 9/y, 3/fg 0/bg var dummy/eax: int <- overlay-code-point-on-real-screen 0x0903/devanagari-visarga, 0x13/x 9/y, 3/fg 0/bg - # render the same devanagari letters as a single stream of utf-8 graphemes rather than individual code-points. + # render the same devanagari letters as a single stream of utf-8 code-point-utf8s rather than individual code-points. var text-storage: (stream byte 0x200) var text/esi: (addr stream byte) <- address text-storage - var g/eax: grapheme <- to-grapheme 0x0915/devanagari-letter-ka - var ka/ecx: grapheme <- copy g + var g/eax: code-point-utf8 <- to-utf8 0x0915/devanagari-letter-ka + var ka/ecx: code-point-utf8 <- copy g # ka - write-grapheme text, ka + write-code-point-utf8 text, ka # kaa - write-grapheme text, ka - g <- to-grapheme 0x093e/devanagari-vowel-aa - write-grapheme text, g + write-code-point-utf8 text, ka + g <- to-utf8 0x093e/devanagari-vowel-aa + write-code-point-utf8 text, g # ki - write-grapheme text, ka - g <- to-grapheme 0x093f/devanagari-vowel-i - write-grapheme text, g + write-code-point-utf8 text, ka + g <- to-utf8 0x093f/devanagari-vowel-i + write-code-point-utf8 text, g # kee - write-grapheme text, ka - g <- to-grapheme 0x0940/devanagari-vowel-ii - write-grapheme text, g + write-code-point-utf8 text, ka + g <- to-utf8 0x0940/devanagari-vowel-ii + write-code-point-utf8 text, g # ku - write-grapheme text, ka - g <- to-grapheme 0x0941/devanagari-vowel-u - write-grapheme text, g + write-code-point-utf8 text, ka + g <- to-utf8 0x0941/devanagari-vowel-u + write-code-point-utf8 text, g # koo - write-grapheme text, ka - g <- to-grapheme 0x0942/devanagari-vowel-oo - write-grapheme text, g + write-code-point-utf8 text, ka + g <- to-utf8 0x0942/devanagari-vowel-oo + write-code-point-utf8 text, g # kay - write-grapheme text, ka - g <- to-grapheme 0x0947/devanagari-vowel-E - write-grapheme text, g + write-code-point-utf8 text, ka + g <- to-utf8 0x0947/devanagari-vowel-E + write-code-point-utf8 text, g # kai - write-grapheme text, ka - g <- to-grapheme 0x0948/devanagari-vowel-ai - write-grapheme text, g + write-code-point-utf8 text, ka + g <- to-utf8 0x0948/devanagari-vowel-ai + write-code-point-utf8 text, g # ko - write-grapheme text, ka - g <- to-grapheme 0x094b/devanagari-vowel-o - write-grapheme text, g + write-code-point-utf8 text, ka + g <- to-utf8 0x094b/devanagari-vowel-o + write-code-point-utf8 text, g # kow - write-grapheme text, ka - g <- to-grapheme 0x094f/devanagari-vowel-aw - write-grapheme text, g + write-code-point-utf8 text, ka + g <- to-utf8 0x094f/devanagari-vowel-aw + write-code-point-utf8 text, g # kan - write-grapheme text, ka - g <- to-grapheme 0x0902/devanagari-anusvara - write-grapheme text, g + write-code-point-utf8 text, ka + g <- to-utf8 0x0902/devanagari-anusvara + write-code-point-utf8 text, g # kaha - write-grapheme text, ka - g <- to-grapheme 0x0903/devanagari-visarga - write-grapheme text, g + write-code-point-utf8 text, ka + g <- to-utf8 0x0903/devanagari-visarga + write-code-point-utf8 text, g # render everything set-cursor-position screen, 4/x 0xe/y draw-stream-wrapping-right-then-down-from-cursor-over-full-screen screen, text, 3/fg 0/bg - # a stream of tamil graphemes (with interspersed spaces for clarity) that don't look the same in Mu + # a stream of tamil code-point-utf8s (with interspersed spaces for clarity) that don't look the same in Mu set-cursor-position 0, 4/x 0x12/y draw-text-wrapping-right-then-down-from-cursor-over-full-screen 0, "எ ஃ கு ", 3/fg 0/bg set-cursor-position 0, 4/x 0x13/y diff --git a/apps/ex9.mu b/apps/ex9.mu index deb3f2f7..c192bde8 100644 --- a/apps/ex9.mu +++ b/apps/ex9.mu @@ -33,7 +33,7 @@ fn word-count in: (addr stream byte) -> _/eax: int { var done?/eax: boolean <- stream-empty? in compare done?, 0/false break-if-!= - var g/eax: grapheme <- read-grapheme in + var g/eax: code-point-utf8 <- read-code-point-utf8 in { compare g, 0x20/space break-if-!= diff --git a/apps/hest-life.mu b/apps/hest-life.mu index 721db5c8..340f7214 100644 --- a/apps/hest-life.mu +++ b/apps/hest-life.mu @@ -28,7 +28,7 @@ fn main screen: (addr screen), keyboard: (addr keyboard), data-disk: (addr disk) var second-screen/edi: (addr screen) <- address second-buffer initialize-screen second-screen, 0x80, 0x30, 1/include-pixels render second-screen, env - convert-graphemes-to-pixels second-screen + convert-code-point-utf8s-to-pixels second-screen copy-pixels second-screen, screen { edit keyboard, env @@ -39,7 +39,7 @@ fn main screen: (addr screen), keyboard: (addr keyboard), data-disk: (addr disk) step env clear-screen second-screen render second-screen, env - convert-graphemes-to-pixels second-screen + convert-code-point-utf8s-to-pixels second-screen copy-pixels second-screen, screen } linger |