This commit is contained in:
Ryan Oldenburg 2021-05-10 13:48:08 -05:00
parent f67b17348f
commit f9064af992
2 changed files with 20 additions and 0 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.7 KiB

View file

@ -609,3 +609,23 @@ block:
)
doDiff(image, "alignments")
block:
var font = readFont("tests/fonts/IBMPlexSans-Regular_2.ttf")
font.size = 48
font.paint = Paint(
kind: pkGradientLinear,
gradientHandlePositions: @[
vec2(0, 50),
vec2(100, 50),
],
gradientStops: @[
ColorStop(color: rgba(255, 0, 0, 255), position: 0),
ColorStop(color: rgba(255, 0, 0, 40), position: 1.0),
]
)
let image = newImage(100, 100)
image.fillText(font, "Text")
image.writeFile("tests/fonts/image_paint_fill.png")