summaryrefslogtreecommitdiff
path: root/tests/typ/text
diff options
context:
space:
mode:
authordamaxwell <damaxwell@alaska.edu>2023-07-17 08:19:46 -0800
committerGitHub <noreply@github.com>2023-07-17 18:19:46 +0200
commit7a1cd362aa150045371cc85578ef50bef2951be2 (patch)
treed23560866992a426d2cb2ab1dcb04cf1ebb82699 /tests/typ/text
parent9b72ee4d221d1e9e8031e53631aaccd06841ff04 (diff)
Support for bounding box text edges (#1626)
Diffstat (limited to 'tests/typ/text')
-rw-r--r--tests/typ/text/edge.typ18
1 files changed, 16 insertions, 2 deletions
diff --git a/tests/typ/text/edge.typ b/tests/typ/text/edge.typ
index 85aff68a..053576e8 100644
--- a/tests/typ/text/edge.typ
+++ b/tests/typ/text/edge.typ
@@ -9,17 +9,31 @@
From #top to #bottom
]
+#let try-bounds(top, bottom) = rect(inset: 0pt, fill: conifer)[
+ #set text(font: "IBM Plex Mono", top-edge: top, bottom-edge: bottom)
+ #top to #bottom: "yay, Typst"
+]
+
#try("ascender", "descender")
#try("ascender", "baseline")
#try("cap-height", "baseline")
#try("x-height", "baseline")
+#try-bounds("cap-height", "baseline")
+#try-bounds("bounds", "baseline")
+#try-bounds("bounds", "bounds")
+#try-bounds("x-height", "bounds")
+
#try(4pt, -2pt)
#try(1pt + 0.3em, -0.15em)
---
-// Error: 21-23 expected "ascender", "cap-height", "x-height", "baseline", "descender", or length, found array
+// Error: 21-23 expected "ascender", "cap-height", "x-height", "baseline", "bounds", or length, found array
#set text(top-edge: ())
---
-// Error: 24-26 expected "ascender", "cap-height", "x-height", "baseline", "descender", or length
+// Error: 24-26 expected "baseline", "descender", "bounds", or length
#set text(bottom-edge: "")
+
+---
+// Error: 24-36 expected "baseline", "descender", "bounds", or length
+#set text(bottom-edge: "cap-height")