summaryrefslogtreecommitdiff
path: root/tests/typ/text/edge.typ
blob: 85aff68a6aac5b3804f44e5ee1c55342dc2f2118 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
// Test top and bottom text edge.

---
#set page(width: 160pt)
#set text(size: 8pt)

#let try(top, bottom) = rect(inset: 0pt, fill: conifer)[
  #set text(font: "IBM Plex Mono", top-edge: top, bottom-edge: bottom)
  From #top to #bottom
]

#try("ascender", "descender")
#try("ascender", "baseline")
#try("cap-height", "baseline")
#try("x-height", "baseline")
#try(4pt, -2pt)
#try(1pt + 0.3em, -0.15em)

---
// Error: 21-23 expected "ascender", "cap-height", "x-height", "baseline", "descender", or length, found array
#set text(top-edge: ())

---
// Error: 24-26 expected "ascender", "cap-height", "x-height", "baseline", "descender", or length
#set text(bottom-edge: "")