mirror of
https://github.com/typst/typst
synced 2025-05-13 20:46:23 +08:00
34 lines
852 B
Typst
34 lines
852 B
Typst
// Test text decorations.
|
|
|
|
---
|
|
#let red = rgb("fc0030")
|
|
|
|
// Basic strikethrough.
|
|
#strike[Statements dreamt up by the utterly deranged.]
|
|
|
|
// Move underline down.
|
|
#underline(offset: 5pt)[Further below.]
|
|
|
|
// Different color.
|
|
#underline(red, evade: false)[Critical information is conveyed here.]
|
|
|
|
// Inherits font color.
|
|
#text(fill: red, underline[Change with the wind.])
|
|
|
|
// Both over- and underline.
|
|
#overline(underline[Running amongst the wolves.])
|
|
|
|
---
|
|
#let redact = strike.with(10pt, extent: 0.05em)
|
|
#let highlight = strike.with(stroke: 10pt + rgb("abcdef88"), extent: 0.05em)
|
|
|
|
// Abuse thickness and transparency for redacting and highlighting stuff.
|
|
Sometimes, we work #redact[in secret].
|
|
There might be #highlight[redacted] things.
|
|
underline()
|
|
|
|
---
|
|
// Test stroke folding.
|
|
#set underline(stroke: 2pt, offset: 2pt)
|
|
#underline(text(red, [DANGER!]))
|