add and export glyph that is meant to represent an unknown ascii character
This commit is contained in:
8
fonts/unknown-char.dsc
Normal file
8
fonts/unknown-char.dsc
Normal file
@@ -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
|
||||||
63
fonts/unknown-char.sml
Normal file
63
fonts/unknown-char.sml
Normal file
@@ -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
|
||||||
@@ -10,9 +10,9 @@ struct
|
|||||||
|
|
||||||
datatype parse_result = OK of AppType.triangle list | PARSE_ERROR
|
datatype parse_result = OK of AppType.triangle list | PARSE_ERROR
|
||||||
|
|
||||||
val structureName = "UpperCaseZ"
|
val structureName = "UnknownChar"
|
||||||
val filename = "fonts/upper-case-z.dsc"
|
val filename = "fonts/unknown-char.dsc"
|
||||||
val exportFilename = "fonts/upper-case-z.sml"
|
val exportFilename = "fonts/unknown-char.sml"
|
||||||
|
|
||||||
fun ndcToLerpX num =
|
fun ndcToLerpX num =
|
||||||
let
|
let
|
||||||
|
|||||||
Reference in New Issue
Block a user