summaryrefslogtreecommitdiff
path: root/tests/typ/elements
diff options
context:
space:
mode:
authorLaurenz <laurmaedje@gmail.com>2021-11-20 15:51:07 +0100
committerLaurenz <laurmaedje@gmail.com>2021-11-20 15:51:07 +0100
commitcef46e6c40fed0089a20e44ff2f251c06878891c (patch)
treea4f12ced1441a014f0446f5b01e3f0f87bdd21b5 /tests/typ/elements
parent70c0dd767452772d29167e39b1c4f919519422ce (diff)
Strokes
Diffstat (limited to 'tests/typ/elements')
-rw-r--r--tests/typ/elements/circle.typ16
-rw-r--r--tests/typ/elements/ellipse.typ3
-rw-r--r--tests/typ/elements/rect.typ9
-rw-r--r--tests/typ/elements/square.typ6
4 files changed, 21 insertions, 13 deletions
diff --git a/tests/typ/elements/circle.typ b/tests/typ/elements/circle.typ
index 5be9cf56..b89c8a0d 100644
--- a/tests/typ/elements/circle.typ
+++ b/tests/typ/elements/circle.typ
@@ -3,17 +3,18 @@
---
// Default circle.
#circle()
+#circle[Hey]
---
// Test auto sizing.
Auto-sized circle. \
-#circle(fill: rgb("eb5278"))[
- #align(center, center)[But, soft!]
-]
+#circle(fill: rgb("eb5278"), thickness: 2pt,
+ align(center, center)[But, soft!]
+)
Center-aligned rect in auto-sized circle.
-#circle(fill: forest,
+#circle(fill: forest, stroke: conifer,
align(center, center,
rect(fill: conifer, pad(5pt)[But, soft!])
)
@@ -21,17 +22,18 @@ Center-aligned rect in auto-sized circle.
Rect in auto-sized circle. \
#circle(fill: forest,
- rect(fill: conifer)[
+ rect(fill: conifer, stroke: white, padding: 4pt)[
+ #font(8pt)
But, soft! what light through yonder window breaks?
]
)
Expanded by height.
-#circle(fill: conifer)[A \ B \ C]
+#circle(stroke: black, align(center)[A \ B \ C])
---
// Ensure circle directly in rect works.
-#rect(width: 40pt, height: 30pt, circle(fill: forest))
+#rect(width: 40pt, height: 30pt, fill: forest, circle(fill: conifer))
---
// Test relative sizing.
diff --git a/tests/typ/elements/ellipse.typ b/tests/typ/elements/ellipse.typ
index 9c36fb1c..49b1514d 100644
--- a/tests/typ/elements/ellipse.typ
+++ b/tests/typ/elements/ellipse.typ
@@ -17,6 +17,7 @@ Rect in ellipse in fixed rect. \
)
Auto-sized ellipse. \
-#ellipse(fill: conifer)[
+#ellipse(fill: conifer, stroke: forest, thickness: 3pt, padding: 3pt)[
+ #font(8pt)
But, soft! what light through yonder window breaks?
]
diff --git a/tests/typ/elements/rect.typ b/tests/typ/elements/rect.typ
index 59dd4ee0..bb666fb2 100644
--- a/tests/typ/elements/rect.typ
+++ b/tests/typ/elements/rect.typ
@@ -8,10 +8,15 @@
#page(width: 150pt)
// Fit to text.
-#rect(fill: conifer)[Textbox]
+#rect(fill: conifer, padding: 3pt)[Textbox]
// Empty with fixed width and height.
-#rect(width: 3cm, height: 12pt, fill: rgb("ed8a4c"))
+#block(rect(
+ height: 15pt,
+ fill: rgb("46b3c2"),
+ stroke: rgb("234994"),
+ thickness: 2pt,
+))
// Fixed width, text height.
#rect(width: 2cm, fill: rgb("9650d6"), pad(5pt)[Fixed and padded])
diff --git a/tests/typ/elements/square.typ b/tests/typ/elements/square.typ
index 3163f872..32a26ea6 100644
--- a/tests/typ/elements/square.typ
+++ b/tests/typ/elements/square.typ
@@ -7,16 +7,16 @@
---
// Test auto-sized square.
-#square(fill: eastern)[
+#square(fill: eastern, padding: 5pt)[
#font(fill: white, weight: "bold")
- #align(center, pad(5pt)[Typst])
+ Typst
]
---
// Test relative-sized child.
#square(fill: eastern)[
#rect(width: 10pt, height: 5pt, fill: conifer) \
- #rect(width: 40%, height: 5pt, fill: conifer)
+ #rect(width: 40%, height: 5pt, stroke: conifer)
]
---