Files
sml-projects/fonts/ampersand.sml

318 lines
10 KiB
Standard ML
Raw Normal View History

2025-08-18 01:11:23 +01:00
structure Ampersand =
2024-09-30 11:55:43 +01:00
struct
2025-08-18 01:11:23 +01:00
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, scale, windowWidth, windowHeight) =
2024-09-30 11:55:43 +01:00
let
2025-08-18 01:11:23 +01:00
val halfWidth = windowWidth / 2.0
val halfHeight = windowHeight / 2.0
2024-09-30 11:55:43 +01:00
in
2025-08-18 01:11:23 +01:00
#[
xToNdc (xOffset, 0.000000000000000, scale, halfWidth),
yToNdc (yOffset, 10.000000000000000, scale, halfHeight),
0.000000000000000,
0.000000000000000,
0.000000000000000,
xToNdc (xOffset, 1.000000000000000, scale, halfWidth),
yToNdc (yOffset, 10.000000000000000, scale, halfHeight),
0.000000000000000,
0.000000000000000,
0.000000000000000,
xToNdc (xOffset, 0.000000000000000, scale, halfWidth),
yToNdc (yOffset, 7.000000000000000, scale, halfHeight),
0.000000000000000,
0.000000000000000,
0.000000000000000,
xToNdc (xOffset, 0.000000000000000, scale, halfWidth),
yToNdc (yOffset, 7.000000000000000, scale, halfHeight),
0.000000000000000,
0.000000000000000,
0.000000000000000,
xToNdc (xOffset, 1.000000000000000, scale, halfWidth),
yToNdc (yOffset, 10.000000000000000, scale, halfHeight),
0.000000000000000,
0.000000000000000,
0.000000000000000,
xToNdc (xOffset, 1.000000000000000, scale, halfWidth),
yToNdc (yOffset, 7.000000000000000, scale, halfHeight),
0.000000000000000,
0.000000000000000,
0.000000000000000,
xToNdc (xOffset, 1.000000000000000, scale, halfWidth),
yToNdc (yOffset, 5.000000000000000, scale, halfHeight),
0.000000000000000,
0.000000000000000,
0.000000000000000,
xToNdc (xOffset, 2.000000000000000, scale, halfWidth),
yToNdc (yOffset, 5.000000000000000, scale, halfHeight),
0.000000000000000,
0.000000000000000,
0.000000000000000,
xToNdc (xOffset, 1.000000000000000, scale, halfWidth),
yToNdc (yOffset, 3.000000000000000, scale, halfHeight),
0.000000000000000,
0.000000000000000,
0.000000000000000,
xToNdc (xOffset, 1.000000000000000, scale, halfWidth),
yToNdc (yOffset, 3.000000000000000, scale, halfHeight),
0.000000000000000,
0.000000000000000,
0.000000000000000,
xToNdc (xOffset, 2.000000000000000, scale, halfWidth),
yToNdc (yOffset, 5.000000000000000, scale, halfHeight),
0.000000000000000,
0.000000000000000,
0.000000000000000,
xToNdc (xOffset, 2.000000000000000, scale, halfWidth),
yToNdc (yOffset, 3.000000000000000, scale, halfHeight),
0.000000000000000,
0.000000000000000,
0.000000000000000,
xToNdc (xOffset, 1.000000000000000, scale, halfWidth),
yToNdc (yOffset, 7.000000000000000, scale, halfHeight),
0.000000000000000,
0.000000000000000,
0.000000000000000,
xToNdc (xOffset, 3.000000000000000, scale, halfWidth),
yToNdc (yOffset, 7.000000000000000, scale, halfHeight),
0.000000000000000,
0.000000000000000,
0.000000000000000,
xToNdc (xOffset, 1.000000000000000, scale, halfWidth),
yToNdc (yOffset, 6.000000000000000, scale, halfHeight),
0.000000000000000,
0.000000000000000,
0.000000000000000,
xToNdc (xOffset, 1.000000000000000, scale, halfWidth),
yToNdc (yOffset, 6.000000000000000, scale, halfHeight),
0.000000000000000,
0.000000000000000,
0.000000000000000,
xToNdc (xOffset, 3.000000000000000, scale, halfWidth),
yToNdc (yOffset, 7.000000000000000, scale, halfHeight),
0.000000000000000,
0.000000000000000,
0.000000000000000,
xToNdc (xOffset, 3.000000000000000, scale, halfWidth),
yToNdc (yOffset, 6.000000000000000, scale, halfHeight),
0.000000000000000,
0.000000000000000,
0.000000000000000,
xToNdc (xOffset, 1.000000000000000, scale, halfWidth),
yToNdc (yOffset, 11.000000000000000, scale, halfHeight),
0.000000000000000,
0.000000000000000,
0.000000000000000,
xToNdc (xOffset, 3.000000000000000, scale, halfWidth),
yToNdc (yOffset, 11.000000000000000, scale, halfHeight),
0.000000000000000,
0.000000000000000,
0.000000000000000,
xToNdc (xOffset, 1.000000000000000, scale, halfWidth),
yToNdc (yOffset, 10.000000000000000, scale, halfHeight),
0.000000000000000,
0.000000000000000,
0.000000000000000,
xToNdc (xOffset, 1.000000000000000, scale, halfWidth),
yToNdc (yOffset, 10.000000000000000, scale, halfHeight),
0.000000000000000,
0.000000000000000,
0.000000000000000,
xToNdc (xOffset, 3.000000000000000, scale, halfWidth),
yToNdc (yOffset, 11.000000000000000, scale, halfHeight),
0.000000000000000,
0.000000000000000,
0.000000000000000,
xToNdc (xOffset, 3.000000000000000, scale, halfWidth),
yToNdc (yOffset, 10.000000000000000, scale, halfHeight),
0.000000000000000,
0.000000000000000,
0.000000000000000,
xToNdc (xOffset, 2.000000000000000, scale, halfWidth),
yToNdc (yOffset, 3.000000000000000, scale, halfHeight),
0.000000000000000,
0.000000000000000,
0.000000000000000,
xToNdc (xOffset, 3.000000000000000, scale, halfWidth),
yToNdc (yOffset, 3.000000000000000, scale, halfHeight),
0.000000000000000,
0.000000000000000,
0.000000000000000,
xToNdc (xOffset, 2.000000000000000, scale, halfWidth),
yToNdc (yOffset, 2.000000000000000, scale, halfHeight),
0.000000000000000,
0.000000000000000,
0.000000000000000,
xToNdc (xOffset, 2.000000000000000, scale, halfWidth),
yToNdc (yOffset, 2.000000000000000, scale, halfHeight),
0.000000000000000,
0.000000000000000,
0.000000000000000,
xToNdc (xOffset, 3.000000000000000, scale, halfWidth),
yToNdc (yOffset, 3.000000000000000, scale, halfHeight),
0.000000000000000,
0.000000000000000,
0.000000000000000,
xToNdc (xOffset, 3.000000000000000, scale, halfWidth),
yToNdc (yOffset, 2.000000000000000, scale, halfHeight),
0.000000000000000,
0.000000000000000,
0.000000000000000,
xToNdc (xOffset, 2.000000000000000, scale, halfWidth),
yToNdc (yOffset, 7.000000000000000, scale, halfHeight),
0.000000000000000,
0.000000000000000,
0.000000000000000,
xToNdc (xOffset, 3.000000000000000, scale, halfWidth),
yToNdc (yOffset, 7.000000000000000, scale, halfHeight),
0.000000000000000,
0.000000000000000,
0.000000000000000,
xToNdc (xOffset, 2.000000000000000, scale, halfWidth),
yToNdc (yOffset, 5.000000000000000, scale, halfHeight),
0.000000000000000,
0.000000000000000,
0.000000000000000,
xToNdc (xOffset, 2.000000000000000, scale, halfWidth),
yToNdc (yOffset, 5.000000000000000, scale, halfHeight),
0.000000000000000,
0.000000000000000,
0.000000000000000,
xToNdc (xOffset, 3.000000000000000, scale, halfWidth),
yToNdc (yOffset, 7.000000000000000, scale, halfHeight),
0.000000000000000,
0.000000000000000,
0.000000000000000,
xToNdc (xOffset, 3.000000000000000, scale, halfWidth),
yToNdc (yOffset, 5.000000000000000, scale, halfHeight),
0.000000000000000,
0.000000000000000,
0.000000000000000,
xToNdc (xOffset, 3.000000000000000, scale, halfWidth),
yToNdc (yOffset, 5.000000000000000, scale, halfHeight),
0.000000000000000,
0.000000000000000,
0.000000000000000,
xToNdc (xOffset, 4.000000000000000, scale, halfWidth),
yToNdc (yOffset, 5.000000000000000, scale, halfHeight),
0.000000000000000,
0.000000000000000,
0.000000000000000,
xToNdc (xOffset, 3.000000000000000, scale, halfWidth),
yToNdc (yOffset, 3.000000000000000, scale, halfHeight),
0.000000000000000,
0.000000000000000,
0.000000000000000,
xToNdc (xOffset, 3.000000000000000, scale, halfWidth),
yToNdc (yOffset, 3.000000000000000, scale, halfHeight),
0.000000000000000,
0.000000000000000,
0.000000000000000,
xToNdc (xOffset, 4.000000000000000, scale, halfWidth),
yToNdc (yOffset, 5.000000000000000, scale, halfHeight),
0.000000000000000,
0.000000000000000,
0.000000000000000,
xToNdc (xOffset, 4.000000000000000, scale, halfWidth),
yToNdc (yOffset, 3.000000000000000, scale, halfHeight),
0.000000000000000,
0.000000000000000,
0.000000000000000,
xToNdc (xOffset, 3.000000000000000, scale, halfWidth),
yToNdc (yOffset, 10.000000000000000, scale, halfHeight),
0.000000000000000,
0.000000000000000,
0.000000000000000,
xToNdc (xOffset, 4.000000000000000, scale, halfWidth),
yToNdc (yOffset, 10.000000000000000, scale, halfHeight),
0.000000000000000,
0.000000000000000,
0.000000000000000,
xToNdc (xOffset, 3.000000000000000, scale, halfWidth),
yToNdc (yOffset, 7.000000000000000, scale, halfHeight),
0.000000000000000,
0.000000000000000,
0.000000000000000,
xToNdc (xOffset, 3.000000000000000, scale, halfWidth),
yToNdc (yOffset, 7.000000000000000, scale, halfHeight),
0.000000000000000,
0.000000000000000,
0.000000000000000,
xToNdc (xOffset, 4.000000000000000, scale, halfWidth),
yToNdc (yOffset, 10.000000000000000, scale, halfHeight),
0.000000000000000,
0.000000000000000,
0.000000000000000,
xToNdc (xOffset, 4.000000000000000, scale, halfWidth),
yToNdc (yOffset, 7.000000000000000, scale, halfHeight),
0.000000000000000,
0.000000000000000,
0.000000000000000,
xToNdc (xOffset, 4.000000000000000, scale, halfWidth),
yToNdc (yOffset, 7.000000000000000, scale, halfHeight),
0.000000000000000,
0.000000000000000,
0.000000000000000,
xToNdc (xOffset, 5.000000000000000, scale, halfWidth),
yToNdc (yOffset, 7.000000000000000, scale, halfHeight),
0.000000000000000,
0.000000000000000,
0.000000000000000,
xToNdc (xOffset, 4.000000000000000, scale, halfWidth),
yToNdc (yOffset, 6.000000000000000, scale, halfHeight),
0.000000000000000,
0.000000000000000,
0.000000000000000,
xToNdc (xOffset, 4.000000000000000, scale, halfWidth),
yToNdc (yOffset, 6.000000000000000, scale, halfHeight),
0.000000000000000,
0.000000000000000,
0.000000000000000,
xToNdc (xOffset, 5.000000000000000, scale, halfWidth),
yToNdc (yOffset, 7.000000000000000, scale, halfHeight),
0.000000000000000,
0.000000000000000,
0.000000000000000,
xToNdc (xOffset, 5.000000000000000, scale, halfWidth),
yToNdc (yOffset, 6.000000000000000, scale, halfHeight),
0.000000000000000,
0.000000000000000,
0.000000000000000,
xToNdc (xOffset, 4.000000000000000, scale, halfWidth),
yToNdc (yOffset, 11.000000000000000, scale, halfHeight),
0.000000000000000,
0.000000000000000,
0.000000000000000,
xToNdc (xOffset, 5.000000000000000, scale, halfWidth),
yToNdc (yOffset, 11.000000000000000, scale, halfHeight),
0.000000000000000,
0.000000000000000,
0.000000000000000,
xToNdc (xOffset, 4.000000000000000, scale, halfWidth),
yToNdc (yOffset, 10.000000000000000, scale, halfHeight),
0.000000000000000,
0.000000000000000,
0.000000000000000,
xToNdc (xOffset, 4.000000000000000, scale, halfWidth),
yToNdc (yOffset, 10.000000000000000, scale, halfHeight),
0.000000000000000,
0.000000000000000,
0.000000000000000,
xToNdc (xOffset, 5.000000000000000, scale, halfWidth),
yToNdc (yOffset, 11.000000000000000, scale, halfHeight),
0.000000000000000,
0.000000000000000,
0.000000000000000,
xToNdc (xOffset, 5.000000000000000, scale, halfWidth),
yToNdc (yOffset, 10.000000000000000, scale, halfHeight),
0.000000000000000,
0.000000000000000,
0.000000000000000
]
end
end