diff options
Diffstat (limited to 'tests/typ/layout')
| -rw-r--r-- | tests/typ/layout/container.typ (renamed from tests/typ/layout/box-block.typ) | 0 | ||||
| -rw-r--r-- | tests/typ/layout/image.typ | 59 | ||||
| -rw-r--r-- | tests/typ/layout/shape-aspect.typ | 46 | ||||
| -rw-r--r-- | tests/typ/layout/shape-circle.typ | 51 | ||||
| -rw-r--r-- | tests/typ/layout/shape-ellipse.typ | 23 | ||||
| -rw-r--r-- | tests/typ/layout/shape-fill-stroke.typ | 26 | ||||
| -rw-r--r-- | tests/typ/layout/shape-rect.typ | 30 | ||||
| -rw-r--r-- | tests/typ/layout/shape-square.typ | 39 | ||||
| -rw-r--r-- | tests/typ/layout/table.typ | 13 |
9 files changed, 0 insertions, 287 deletions
diff --git a/tests/typ/layout/box-block.typ b/tests/typ/layout/container.typ index c6928074..c6928074 100644 --- a/tests/typ/layout/box-block.typ +++ b/tests/typ/layout/container.typ diff --git a/tests/typ/layout/image.typ b/tests/typ/layout/image.typ deleted file mode 100644 index 8817713f..00000000 --- a/tests/typ/layout/image.typ +++ /dev/null @@ -1,59 +0,0 @@ -// Test the `image` function. - ---- -// Test loading different image formats. - -// Load an RGBA PNG image. -#image("../../res/rhino.png") - -// Load an RGB JPEG image. -#set page(height: 60pt) -#image("../../res/tiger.jpg") - ---- -// Test configuring the size and fitting behaviour of images. - -// Set width and height explicitly. -#image("../../res/rhino.png", width: 30pt) -#image("../../res/rhino.png", height: 30pt) - -// Set width and height explicitly and force stretching. -#image("../../res/monkey.svg", width: 100%, height: 20pt, fit: "stretch") - -// Make sure the bounding-box of the image is correct. -#align(bottom + right, image("../../res/tiger.jpg", width: 40pt)) - ---- -// Test all three fit modes. -#set page(height: 50pt, margins: 0pt) -#grid( - columns: (1fr, 1fr, 1fr), - rows: 100%, - gutter: 3pt, - image("../../res/tiger.jpg", width: 100%, height: 100%, fit: "contain"), - image("../../res/tiger.jpg", width: 100%, height: 100%, fit: "cover"), - image("../../res/monkey.svg", width: 100%, height: 100%, fit: "stretch"), -) - ---- -// Does not fit to remaining height of page. -#set page(height: 60pt) -Stuff \ -Stuff -#image("../../res/rhino.png") - ---- -// Test baseline. -A #image("../../res/tiger.jpg", height: 1cm, width: 80%) B - ---- -// Test advanced SVG features. -#image("../../res/pattern.svg") - ---- -// Error: 8-29 file not found -#image("path/does/not/exist") - ---- -// Error: 8-21 failed to load image (unknown image format) -#image("./image.typ") diff --git a/tests/typ/layout/shape-aspect.typ b/tests/typ/layout/shape-aspect.typ deleted file mode 100644 index 2c3e9b0c..00000000 --- a/tests/typ/layout/shape-aspect.typ +++ /dev/null @@ -1,46 +0,0 @@ -// Test that squares and circles respect their 1-1 aspect ratio. - ---- -// Test relative width and height and size that is smaller -// than default size. -#set page(width: 120pt, height: 70pt) -#square(width: 50%, align(bottom)[A]) -#square(height: 50%) -#box(stack(square(size: 10pt), 5pt, square(size: 10pt, [B]))) - ---- -// Test alignment in automatically sized square and circle. -#set text(8pt) -#square(padding: 4pt)[ - Hey there, #align(center + bottom, rotate(180deg, [you!])) -] -#circle(align(center + horizon, [Hey.])) - ---- -// Test that maximum wins if both width and height are given. -#square(width: 10pt, height: 20pt) -#circle(width: 20%, height: 10pt) - ---- -// Test square that is limited by region size. -#set page(width: 20pt, height: 10pt, margins: 0pt) -#stack(dir: ltr, square(fill: forest), square(fill: conifer)) - ---- -// Test different ways of sizing. -#set page(width: 120pt, height: 40pt) -#circle(radius: 5pt) -#circle(width: 10%) -#circle(height: 50%) - ---- -// Test square that is overflowing due to its aspect ratio. -#set page(width: 40pt, height: 20pt, margins: 5pt) -#square(width: 100%) -#square(width: 100%)[Hello] - ---- -// Size cannot be relative because we wouldn't know -// relative to which axis. -// Error: 15-18 expected length, found relative -#square(size: 50%) diff --git a/tests/typ/layout/shape-circle.typ b/tests/typ/layout/shape-circle.typ deleted file mode 100644 index 4b978e86..00000000 --- a/tests/typ/layout/shape-circle.typ +++ /dev/null @@ -1,51 +0,0 @@ -// Test the `circle` function. - ---- -// Default circle. -#circle() -#circle[Hey] - ---- -// Test auto sizing. - -Auto-sized circle. \ -#circle(fill: rgb("eb5278"), stroke: black, thickness: 2pt, - align(center + horizon)[But, soft!] -) - -Center-aligned rect in auto-sized circle. -#circle(fill: forest, stroke: conifer, - align(center + horizon, - rect(fill: conifer, padding: 5pt)[But, soft!] - ) -) - -Rect in auto-sized circle. \ -#circle(fill: forest, - rect(fill: conifer, stroke: white, padding: 4pt)[ - #set text(8pt) - But, soft! what light through yonder window breaks? - ] -) - -Expanded by height. -#circle(stroke: black, align(center)[A \ B \ C]) - ---- -// Ensure circle directly in rect works. -#rect(width: 40pt, height: 30pt, fill: forest, circle(fill: conifer)) - ---- -// Test relative sizing. -#let centered(body) = align(center + horizon, body) -#set text(fill: white) -#rect(width: 100pt, height: 50pt, fill: rgb("aaa"), centered[ - #circle(radius: 10pt, fill: eastern, centered[A]) // D=20pt - #circle(height: 60%, fill: eastern, centered[B]) // D=30pt - #circle(width: 20% + 20pt, fill: eastern, centered[C]) // D=40pt -]) - ---- -// Radius wins over width and height. -// Error: 23-34 unexpected argument -#circle(radius: 10pt, width: 50pt, height: 100pt, fill: eastern) diff --git a/tests/typ/layout/shape-ellipse.typ b/tests/typ/layout/shape-ellipse.typ deleted file mode 100644 index 154144c4..00000000 --- a/tests/typ/layout/shape-ellipse.typ +++ /dev/null @@ -1,23 +0,0 @@ -// Test the `ellipse` function. - ---- -// Default ellipse. -#ellipse() - ---- -Rect in ellipse in fixed rect. \ -#rect(width: 3cm, height: 2cm, fill: rgb("2a631a"), - ellipse(fill: forest, width: 100%, height: 100%, - rect(fill: conifer, width: 100%, height: 100%, - align(center + horizon)[ - Stuff inside an ellipse! - ] - ) - ) -) - -Auto-sized ellipse. \ -#ellipse(fill: conifer, stroke: forest, thickness: 3pt, padding: 3pt)[ - #set text(8pt) - But, soft! what light through yonder window breaks? -] diff --git a/tests/typ/layout/shape-fill-stroke.typ b/tests/typ/layout/shape-fill-stroke.typ deleted file mode 100644 index 935f3bc7..00000000 --- a/tests/typ/layout/shape-fill-stroke.typ +++ /dev/null @@ -1,26 +0,0 @@ -// Test shape fill & stroke. - ---- -#let rect with (width: 20pt, height: 10pt) -#let items = for i, rect in ( - rect(stroke: none), - rect(), - rect(fill: none), - rect(thickness: 2pt), - rect(stroke: eastern), - rect(stroke: eastern, thickness: 2pt), - rect(fill: eastern), - rect(fill: eastern, stroke: none), - rect(fill: forest, stroke: none, thickness: 2pt), - rect(fill: forest, stroke: conifer), - rect(fill: forest, stroke: black, thickness: 2pt), - rect(fill: forest, stroke: conifer, thickness: 2pt), -) { - (align(horizon)[{i + 1}.], rect, []) -} - -#grid( - columns: (auto, auto, 1fr, auto, auto, 0fr), - gutter: 5pt, - ..items, -) diff --git a/tests/typ/layout/shape-rect.typ b/tests/typ/layout/shape-rect.typ deleted file mode 100644 index add39b80..00000000 --- a/tests/typ/layout/shape-rect.typ +++ /dev/null @@ -1,30 +0,0 @@ -// Test the `rect` function. - ---- -// Default rectangle. -#rect() - ---- -#set page(width: 150pt) - -// Fit to text. -#rect(fill: conifer, padding: 3pt)[Textbox] - -// Empty with fixed width and height. -#block(rect( - height: 15pt, - fill: rgb("46b3c2"), - stroke: rgb("234994"), - thickness: 2pt, -)) - -// Fixed width, text height. -#rect(width: 2cm, fill: rgb("9650d6"), padding: 5pt)[Fixed and padded] - -// Page width, fixed height. -#rect(height: 1cm, width: 100%, fill: rgb("734ced"))[Topleft] - -// These are inline with text. -\{#rect(width: 0.5in, height: 7pt, fill: rgb("d6cd67")) - #rect(width: 0.5in, height: 7pt, fill: rgb("edd466")) - #rect(width: 0.5in, height: 7pt, fill: rgb("e3be62"))\} diff --git a/tests/typ/layout/shape-square.typ b/tests/typ/layout/shape-square.typ deleted file mode 100644 index c4ece778..00000000 --- a/tests/typ/layout/shape-square.typ +++ /dev/null @@ -1,39 +0,0 @@ -// Test the `square` function. - ---- -// Default square. -#square() -#square[hey!] - ---- -// Test auto-sized square. -#square(fill: eastern, padding: 5pt)[ - #set text(fill: white, weight: "bold") - Typst -] - ---- -// Test relative-sized child. -#square(fill: eastern)[ - #rect(width: 10pt, height: 5pt, fill: conifer) \ - #rect(width: 40%, height: 5pt, stroke: conifer) -] - ---- -// Test text overflowing height. -#set page(width: 75pt, height: 100pt) -#square(fill: conifer)[ - But, soft! what light through yonder window breaks? -] - ---- -// Test that square does not overflow page. -#set page(width: 100pt, height: 75pt) -#square(fill: conifer)[ - But, soft! what light through yonder window breaks? -] - ---- -// Size wins over width and height. -// Error: 09-20 unexpected argument -#square(width: 10cm, height: 20cm, size: 1cm, fill: rgb("eb5278")) diff --git a/tests/typ/layout/table.typ b/tests/typ/layout/table.typ deleted file mode 100644 index 0372951c..00000000 --- a/tests/typ/layout/table.typ +++ /dev/null @@ -1,13 +0,0 @@ -#set page(height: 70pt) -#set table(primary: rgb("aaa"), secondary: none) - -#table( - columns: (1fr,) * 3, - stroke: rgb("333"), - thickness: 2pt, - [A], [B], [C], [], [], [D \ E \ F \ \ \ G], [H], -) - ---- -// Ref: false -#table() |
