morepretty

This commit is contained in:
Ryan Oldenburg 2021-10-27 16:44:22 -05:00
parent a718fb6b1b
commit 4a0d9c29b8
5 changed files with 17 additions and 14 deletions

View file

@ -10,7 +10,7 @@ var
frameCount = 0
image = Image(w, h)
app = App()
frame = Frame(title="wNim/Pixie")
frame = Frame(title = "wNim/Pixie")
proc draw() =
# draw shiny sphere on gradient background

View file

@ -808,7 +808,9 @@ proc parseKernTable(buf: string, offset: int): KernTable =
else:
failUnsupported("Kern version")
proc parseCFFIndexOffsets(buf: string, start: var int, stripZero = false): seq[(int, int)] =
proc parseCFFIndexOffsets(
buf: string, start: var int, stripZero = false
): seq[(int, int)] =
proc getOffset(buf: string, offset, offSize: int): int =
var v = 0

View file

@ -32,6 +32,7 @@ import chroma, pixie, pixie/fileformats/bmp
block:
for bits in [32, 24]:
let image =
decodeBmp(readFile("tests/fileformats/bmp/knight." & $bits & ".master.bmp"))
let image = decodeBmp(readFile(
"tests/fileformats/bmp/knight." & $bits & ".master.bmp"
))
writeFile("tests/fileformats/bmp/knight." & $bits & ".bmp", encodeBmp(image))

View file

@ -244,10 +244,10 @@ block:
b = readImage(&"tests/images/turtle.png")
a.fill(rgba(255, 255, 255, 255))
let m = translate(vec2(50, 50)) * rotate(-5.toRadians)
a.draw(b, m * translate(vec2(0,0)))
a.draw(b, m * translate(vec2(-40,0)))
a.draw(b, m * translate(vec2(-40,-40)))
a.draw(b, m * translate(vec2(0,-40)))
a.draw(b, m * translate(vec2(0, 0)))
a.draw(b, m * translate(vec2(-40, 0)))
a.draw(b, m * translate(vec2(-40, -40)))
a.draw(b, m * translate(vec2(0, -40)))
doDiff(a, "smooth12")
block:

View file

@ -2,10 +2,10 @@ import pixie, stb_truetype, unicode
let fontFiles = [
# "tests/fonts/Roboto-Regular_1.ttf"
# "tests/fonts/Aclonica-Regular_1.ttf"
# "tests/fonts/Ubuntu-Regular_1.ttf"
# "tests/fonts/IBMPlexSans-Regular_2.ttf"
# "tests/fonts/NotoSans-Regular_4.ttf"
# "tests/fonts/Aclonica-Regular_1.ttf"
# "tests/fonts/Ubuntu-Regular_1.ttf"
# "tests/fonts/IBMPlexSans-Regular_2.ttf"
# "tests/fonts/NotoSans-Regular_4.ttf"
"tests/fonts/Pacifico-Regular_4.ttf"
]
@ -38,5 +38,5 @@ for fontFile in fontFiles:
echo "DISAGREE: ", a, " != ", b, " <<<<<<<<<<<<<<<<<<<<<<<<<<<"
# quit()
# echo stbtt.getCodepointKernAdvance(Rune('r'), Rune('s')).float32
# echo font.typeface.getKerningAdjustment(Rune('r'), Rune('s'))
# echo stbtt.getCodepointKernAdvance(Rune('r'), Rune('s')).float32
# echo font.typeface.getKerningAdjustment(Rune('r'), Rune('s'))