Files
sml-projects/cozette-sml/fonts-with-z-index/exclamation_mark.sml

67 lines
1.9 KiB
Standard ML
Raw Normal View History

structure ExclamationMark =
struct
fun xToNdc (xOffset, xpos, scale, halfWidth) =
((xpos * scale + xOffset) - halfWidth) / halfWidth
fun yToNdc (yOffset, ypos, scale, halfHeight) =
~(((ypos * scale + yOffset) - halfHeight) / halfHeight)
fun lerp (xOffset: Real32.real, yOffset, z, scale, windowWidth, windowHeight,
r, g, b) =
let
val halfWidth = windowWidth / 2.0
val halfHeight = windowHeight / 2.0
in
#[
xToNdc (xOffset, 1.000000000000000, scale, halfWidth),
yToNdc (yOffset, 8.000000000000000, scale, halfHeight),
z,
r, g, b,
xToNdc (xOffset, 2.000000000000000, scale, halfWidth),
yToNdc (yOffset, 8.000000000000000, scale, halfHeight),
z,
r, g, b,
xToNdc (xOffset, 1.000000000000000, scale, halfWidth),
yToNdc (yOffset, 2.000000000000000, scale, halfHeight),
z,
r, g, b,
xToNdc (xOffset, 1.000000000000000, scale, halfWidth),
yToNdc (yOffset, 2.000000000000000, scale, halfHeight),
z,
r, g, b,
xToNdc (xOffset, 2.000000000000000, scale, halfWidth),
yToNdc (yOffset, 8.000000000000000, scale, halfHeight),
z,
r, g, b,
xToNdc (xOffset, 2.000000000000000, scale, halfWidth),
yToNdc (yOffset, 2.000000000000000, scale, halfHeight),
z,
r, g, b,
xToNdc (xOffset, 1.000000000000000, scale, halfWidth),
yToNdc (yOffset, 10.000000000000000, scale, halfHeight),
z,
r, g, b,
xToNdc (xOffset, 2.000000000000000, scale, halfWidth),
yToNdc (yOffset, 10.000000000000000, scale, halfHeight),
z,
r, g, b,
xToNdc (xOffset, 1.000000000000000, scale, halfWidth),
yToNdc (yOffset, 9.000000000000000, scale, halfHeight),
z,
r, g, b,
xToNdc (xOffset, 1.000000000000000, scale, halfWidth),
yToNdc (yOffset, 9.000000000000000, scale, halfHeight),
z,
r, g, b,
xToNdc (xOffset, 2.000000000000000, scale, halfWidth),
yToNdc (yOffset, 10.000000000000000, scale, halfHeight),
z,
r, g, b,
xToNdc (xOffset, 2.000000000000000, scale, halfWidth),
yToNdc (yOffset, 9.000000000000000, scale, halfHeight),
z,
r, g, b
]
end
end