From 8db8487f7a859eb9e31004c5ec59089ab6deb3f3 Mon Sep 17 00:00:00 2001 From: Humza Shahid Date: Mon, 23 Sep 2024 14:04:43 +0100 Subject: [PATCH] add and export glyph that is meant to represent an unknown ascii character --- dotscape | Bin 1049312 -> 1049312 bytes fonts/unknown-char.dsc | 8 ++++ fonts/unknown-char.sml | 63 +++++++++++++++++++++++++++++++ imperative-shell/file-thread.sml | 6 +-- 4 files changed, 74 insertions(+), 3 deletions(-) create mode 100644 fonts/unknown-char.dsc create mode 100644 fonts/unknown-char.sml diff --git a/dotscape b/dotscape index d82b79b25a8675582b7fa58195be879848fa67a2..dd33a02d6ab1c5b4365db60eb521074fdb5e1b95 100755 GIT binary patch delta 162 zcmaFR>hPe|VZ#+B5r^xKBa7$u7Qb7hVGZNt`;% delta 165 zcmaFR>hPe|VZ#+Bk;HnNvYsNwd-boMD>L+J-#xc=+m7ZJOzkh27=ai>GXpUT5VHa? z8xXStF$WNHZhyhV6~R9J2NRb7cW6ODYLRndacUI9_Gm7yEgak+0o`Pvh;G$(DPgX& o%z{WFdd0ap3=GpRh;vD_3y5<8F*gwN05LBR^KBOp=fCh80CpZa@c;k- diff --git a/fonts/unknown-char.dsc b/fonts/unknown-char.dsc new file mode 100644 index 0000000..a3831e1 --- /dev/null +++ b/fonts/unknown-char.dsc @@ -0,0 +1,8 @@ +x 0.599999964237 y ~0.466666638851 x 0.599999964237 y 0.466666638851 x 0.466666638851 y 0.466666638851 +x 0.466666638851 y 0.466666638851 x 0.466666638851 y ~0.466666638851 x 0.599999964237 y ~0.466666638851 +x 0.599999964237 y 0.599999964237 x ~0.466666668653 y 0.599999964237 x ~0.466666668653 y 0.466666638851 +x ~0.466666668653 y 0.466666638851 x 0.599999964237 y 0.466666638851 x 0.599999964237 y 0.599999964237 +x ~0.466666668653 y 0.599999964237 x ~0.466666668653 y ~0.466666638851 x ~0.599999964237 y ~0.466666638851 +x ~0.599999964237 y ~0.466666638851 x ~0.599999964237 y 0.599999964237 x ~0.466666668653 y 0.599999964237 +x 0.599999964237 y ~0.466666638851 x ~0.599999964237 y ~0.466666638851 x ~0.599999964237 y ~0.599999964237 +x ~0.599999964237 y ~0.599999964237 x 0.599999964237 y ~0.599999964237 x 0.599999964237 y ~0.466666638851 diff --git a/fonts/unknown-char.sml b/fonts/unknown-char.sml new file mode 100644 index 0000000..47dd9fd --- /dev/null +++ b/fonts/unknown-char.sml @@ -0,0 +1,63 @@ +structure UnknownChar = +struct + fun lerp (startX, startY, drawWidth, drawHeight, windowWidth, windowHeight, r, g, b) : Real32.real vector = + let + val startX = Real32.fromInt startX + val startY = Real32.fromInt startY + val endY = windowHeight - startY + val startY = windowHeight - (startY + drawHeight) + val endX = startX + drawWidth + val windowHeight = windowHeight / 2.0 + val windowWidth = windowWidth / 2.0 + in + #[ (((startX * (1.0 - 0.799999952316)) + (endX * 0.799999952316)) / windowWidth) - 1.0, + (((startY * (1.0 - 0.266666680574)) + (endY * 0.266666680574)) / windowHeight) - 1.0, r, g, b, + (((startX * (1.0 - 0.799999952316)) + (endX * 0.799999952316)) / windowWidth) - 1.0, + (((startY * (1.0 - 0.733333349228)) + (endY * 0.733333349228)) / windowHeight) - 1.0, r, g, b, + (((startX * (1.0 - 0.733333349228)) + (endX * 0.733333349228)) / windowWidth) - 1.0, + (((startY * (1.0 - 0.733333349228)) + (endY * 0.733333349228)) / windowHeight) - 1.0, r, g, b, + (((startX * (1.0 - 0.733333349228)) + (endX * 0.733333349228)) / windowWidth) - 1.0, + (((startY * (1.0 - 0.733333349228)) + (endY * 0.733333349228)) / windowHeight) - 1.0, r, g, b, + (((startX * (1.0 - 0.733333349228)) + (endX * 0.733333349228)) / windowWidth) - 1.0, + (((startY * (1.0 - 0.266666680574)) + (endY * 0.266666680574)) / windowHeight) - 1.0, r, g, b, + (((startX * (1.0 - 0.799999952316)) + (endX * 0.799999952316)) / windowWidth) - 1.0, + (((startY * (1.0 - 0.266666680574)) + (endY * 0.266666680574)) / windowHeight) - 1.0, r, g, b, + (((startX * (1.0 - 0.799999952316)) + (endX * 0.799999952316)) / windowWidth) - 1.0, + (((startY * (1.0 - 0.799999952316)) + (endY * 0.799999952316)) / windowHeight) - 1.0, r, g, b, + (((startX * (1.0 - 0.266666650772)) + (endX * 0.266666650772)) / windowWidth) - 1.0, + (((startY * (1.0 - 0.799999952316)) + (endY * 0.799999952316)) / windowHeight) - 1.0, r, g, b, + (((startX * (1.0 - 0.266666650772)) + (endX * 0.266666650772)) / windowWidth) - 1.0, + (((startY * (1.0 - 0.733333349228)) + (endY * 0.733333349228)) / windowHeight) - 1.0, r, g, b, + (((startX * (1.0 - 0.266666650772)) + (endX * 0.266666650772)) / windowWidth) - 1.0, + (((startY * (1.0 - 0.733333349228)) + (endY * 0.733333349228)) / windowHeight) - 1.0, r, g, b, + (((startX * (1.0 - 0.799999952316)) + (endX * 0.799999952316)) / windowWidth) - 1.0, + (((startY * (1.0 - 0.733333349228)) + (endY * 0.733333349228)) / windowHeight) - 1.0, r, g, b, + (((startX * (1.0 - 0.799999952316)) + (endX * 0.799999952316)) / windowWidth) - 1.0, + (((startY * (1.0 - 0.799999952316)) + (endY * 0.799999952316)) / windowHeight) - 1.0, r, g, b, + (((startX * (1.0 - 0.266666650772)) + (endX * 0.266666650772)) / windowWidth) - 1.0, + (((startY * (1.0 - 0.799999952316)) + (endY * 0.799999952316)) / windowHeight) - 1.0, r, g, b, + (((startX * (1.0 - 0.266666650772)) + (endX * 0.266666650772)) / windowWidth) - 1.0, + (((startY * (1.0 - 0.266666680574)) + (endY * 0.266666680574)) / windowHeight) - 1.0, r, g, b, + (((startX * (1.0 - 0.200000017881)) + (endX * 0.200000017881)) / windowWidth) - 1.0, + (((startY * (1.0 - 0.266666680574)) + (endY * 0.266666680574)) / windowHeight) - 1.0, r, g, b, + (((startX * (1.0 - 0.200000017881)) + (endX * 0.200000017881)) / windowWidth) - 1.0, + (((startY * (1.0 - 0.266666680574)) + (endY * 0.266666680574)) / windowHeight) - 1.0, r, g, b, + (((startX * (1.0 - 0.200000017881)) + (endX * 0.200000017881)) / windowWidth) - 1.0, + (((startY * (1.0 - 0.799999952316)) + (endY * 0.799999952316)) / windowHeight) - 1.0, r, g, b, + (((startX * (1.0 - 0.266666650772)) + (endX * 0.266666650772)) / windowWidth) - 1.0, + (((startY * (1.0 - 0.799999952316)) + (endY * 0.799999952316)) / windowHeight) - 1.0, r, g, b, + (((startX * (1.0 - 0.799999952316)) + (endX * 0.799999952316)) / windowWidth) - 1.0, + (((startY * (1.0 - 0.266666680574)) + (endY * 0.266666680574)) / windowHeight) - 1.0, r, g, b, + (((startX * (1.0 - 0.200000017881)) + (endX * 0.200000017881)) / windowWidth) - 1.0, + (((startY * (1.0 - 0.266666680574)) + (endY * 0.266666680574)) / windowHeight) - 1.0, r, g, b, + (((startX * (1.0 - 0.200000017881)) + (endX * 0.200000017881)) / windowWidth) - 1.0, + (((startY * (1.0 - 0.200000017881)) + (endY * 0.200000017881)) / windowHeight) - 1.0, r, g, b, + (((startX * (1.0 - 0.200000017881)) + (endX * 0.200000017881)) / windowWidth) - 1.0, + (((startY * (1.0 - 0.200000017881)) + (endY * 0.200000017881)) / windowHeight) - 1.0, r, g, b, + (((startX * (1.0 - 0.799999952316)) + (endX * 0.799999952316)) / windowWidth) - 1.0, + (((startY * (1.0 - 0.200000017881)) + (endY * 0.200000017881)) / windowHeight) - 1.0, r, g, b, + (((startX * (1.0 - 0.799999952316)) + (endX * 0.799999952316)) / windowWidth) - 1.0, + (((startY * (1.0 - 0.266666680574)) + (endY * 0.266666680574)) / windowHeight) - 1.0, r, g, b + ] + end +end \ No newline at end of file diff --git a/imperative-shell/file-thread.sml b/imperative-shell/file-thread.sml index 2320fc1..5551cb8 100644 --- a/imperative-shell/file-thread.sml +++ b/imperative-shell/file-thread.sml @@ -10,9 +10,9 @@ struct datatype parse_result = OK of AppType.triangle list | PARSE_ERROR - val structureName = "UpperCaseZ" - val filename = "fonts/upper-case-z.dsc" - val exportFilename = "fonts/upper-case-z.sml" + val structureName = "UnknownChar" + val filename = "fonts/unknown-char.dsc" + val exportFilename = "fonts/unknown-char.sml" fun ndcToLerpX num = let