summaryrefslogtreecommitdiff
path: root/tests/typ
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
parent9b72ee4d221d1e9e8031e53631aaccd06841ff04 (diff)
Support for bounding box text edges (#1626)
Diffstat (limited to 'tests/typ')
-rw-r--r--tests/typ/math/attach.typ6
-rw-r--r--tests/typ/text/edge.typ18
2 files changed, 22 insertions, 2 deletions
diff --git a/tests/typ/math/attach.typ b/tests/typ/math/attach.typ
index 0f404ac7..d471551a 100644
--- a/tests/typ/math/attach.typ
+++ b/tests/typ/math/attach.typ
@@ -65,6 +65,12 @@ $ sqrt(a_(1/2)^zeta), sqrt(a_alpha^(1/2)), sqrt(a_(1/2)^(3/4)) \
sqrt(attach(a, tl: 1/2, bl: 3/4, tr: 1/2, br: 3/4)) $
---
+// Test for no collisions between descenders/ascenders and attachments
+
+$ sup_(x in P_i) quad inf_(x in P_i) $
+$ op("fff",limits: #true)^(y) quad op("yyy", limits:#true)_(f) $
+
+---
// Test frame base.
$ (-1)^n + (1/2 + 3)^(-1/2) $
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")