diff options
Diffstat (limited to 'tests')
| -rw-r--r-- | tests/layouts/test.typ | 44 | ||||
| -rw-r--r-- | tests/render.py | 8 |
2 files changed, 21 insertions, 31 deletions
diff --git a/tests/layouts/test.typ b/tests/layouts/test.typ index 063a7bfe..68f73a73 100644 --- a/tests/layouts/test.typ +++ b/tests/layouts/test.typ @@ -1,31 +1,21 @@ [page.size: w=5cm, h=5cm] [page.margins: 0cm] -// [box: w=4cm, h=3cm][1] -// // -// [direction: ttb, ltr] -// [box: w=2cm, h=1][2] -// // -// [direction: btt, rtl] -// [align: bottom, right] -// [box: w=3cm, h=1][3] -// // -// [direction: ltr, ttb] -// [align: center, center] -// [box: w=2cm, h=2cm][4] +// Test 1 +// [box][ +// [align: center] +// [box: ps=3cm, ss=1cm] +// [direction: ttb, ltr] +// [box: ps=3cm, ss=1cm] +// [box: ps=1cm, ss=1cm] +// [box: ps=2cm, ss=1cm] +// [box: ps=1cm, ss=1cm] +// ] -[align: center] - -//[direction: primary=btt, secondary=rtl] -//[align: primary=bottom, secondary=right] -//[box][Hi] - -[box][ -//[align: primary=center, secondary=bottom] -[direction: secondary=btt] -Blabla -[v: 0.5cm] -[align: vertical=end] Origin 2] -//[align: vertical=center] Center -//[align: vertical=center] Center -//[align: vertical=end] End End End +// Test 2 +[align: secondary=top] Top +[align: secondary=center] Center +[align: secondary=bottom] Bottom +[direction: ttb, ltr] +[align: primary=bottom] +[box: w=1cm, h=1cm] diff --git a/tests/render.py b/tests/render.py index 2e105eb2..93d59ea8 100644 --- a/tests/render.py +++ b/tests/render.py @@ -105,10 +105,10 @@ class BoxRenderer: img = Image.new('RGBA', self.size, (255, 255, 255, 255)) pixels = numpy.array(img) - for i in range(0, int(height)): - for j in range(0, int(width)): - if ((i // 2) % 2 == 0) == ((j // 2) % 2 == 0): - pixels[4*i:4*(i+1), 4*j:4*(j+1)] = (225, 225, 225, 255) + # for i in range(0, int(height)): + # for j in range(0, int(width)): + # if ((i // 2) % 2 == 0) == ((j // 2) % 2 == 0): + # pixels[4*i:4*(i+1), 4*j:4*(j+1)] = (225, 225, 225, 255) self.img = Image.fromarray(pixels, 'RGBA') self.draw = ImageDraw.Draw(self.img) |
