pixie/tests/test_svg.nim

32 lines
631 B
Nim
Raw Normal View History

2022-07-09 18:08:34 +00:00
import pixie, pixie/fileformats/svg, strformat, xrays
2020-12-04 16:17:03 +00:00
2020-12-20 00:01:14 +00:00
const files = [
2020-12-20 03:59:43 +00:00
"line01",
"polyline01",
"polygon01",
"rect01",
"rect02",
"circle01",
2020-12-20 18:17:55 +00:00
"ellipse01",
2020-12-20 00:01:14 +00:00
"triangle01",
2020-12-20 02:47:05 +00:00
"quad01",
2021-04-27 00:50:00 +00:00
"Ghostscript_Tiger",
2021-05-24 02:17:30 +00:00
"scale",
2021-05-24 03:29:59 +00:00
"miterlimit",
2021-12-03 21:24:06 +00:00
"dashes",
"dragon2"
2020-12-20 00:01:14 +00:00
]
2020-12-04 20:09:08 +00:00
2021-06-29 02:50:09 +00:00
for file in files:
2022-07-09 06:09:59 +00:00
let image = readImage(&"tests/fileformats/svg/{file}.svg")
2022-07-09 18:08:34 +00:00
image.xray(&"tests/fileformats/svg/masters/{file}.png")
2021-11-26 05:38:57 +00:00
2022-05-22 01:05:13 +00:00
block:
2022-07-09 06:09:59 +00:00
let
svg = parseSvg(
readFile("tests/fileformats/svg/accessibility-outline.svg"),
512, 512
)
image = newImage(svg)
2022-07-09 18:08:34 +00:00
image.xray(&"tests/fileformats/svg/masters/accessibility-outline.png")