fix svgfile aligments and add a test
[PyX.git] / test / functional / test_svgfile.py
blob3be4c043ad0bc8a6319e1fef6688e2c41b7663b5
1 #!/usr/bin/env python
2 import sys; sys.path[:0] = ["../.."]
4 from pyx import *
6 c = canvas.canvas()
8 s = svgfile.svgfile_pt(100, 200, 'data/testsvg.svg', width_pt=450, resolution=96, parsed=True)
9 c.insert(s)
10 c.stroke(s.bbox().enlarged(-style.linewidth.normal.width/2).rect())
11 c.fill(path.circle_pt(105, 205, 5))
12 c.fill(path.circle_pt(105, 495, 5))
13 c.fill(path.circle_pt(545, 205, 5))
14 c.fill(path.circle_pt(545, 495, 5))
16 s = svgfile.svgfile_pt(100, 600, 'data/testsvg.svg', width_pt=450, resolution=96)
17 c.insert(s)
18 c.stroke(s.bbox().enlarged(-style.linewidth.normal.width/2).rect())
19 c.fill(path.circle_pt(105, 605, 5))
20 c.fill(path.circle_pt(105, 895, 5))
21 c.fill(path.circle_pt(545, 605, 5))
22 c.fill(path.circle_pt(545, 895, 5))
24 c.writeSVGfile(page_bboxenlarge=0)