diff options
| author | Laurenz <laurmaedje@gmail.com> | 2023-05-15 10:36:03 +0200 |
|---|---|---|
| committer | Laurenz <laurmaedje@gmail.com> | 2023-05-15 10:36:03 +0200 |
| commit | 1fa56a317c8d8da76546e6b5e19b279d84380837 (patch) | |
| tree | 5bc0acad0b881898511bdf66dc6384f1b5e83de3 /library/src/text | |
| parent | 156aef10c463f81ca0016583a9df83d7b8560e59 (diff) | |
Extract category definitions into individual functions
Diffstat (limited to 'library/src/text')
| -rw-r--r-- | library/src/text/mod.rs | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/library/src/text/mod.rs b/library/src/text/mod.rs index 7ee0b62b..bd15cdd2 100644 --- a/library/src/text/mod.rs +++ b/library/src/text/mod.rs @@ -22,6 +22,25 @@ use typst::font::{FontMetrics, FontStretch, FontStyle, FontWeight, VerticalFontM use crate::layout::ParElem; use crate::prelude::*; +/// Hook up all text definitions. +pub(super) fn define(global: &mut Scope) { + global.define("text", TextElem::func()); + global.define("linebreak", LinebreakElem::func()); + global.define("smartquote", SmartQuoteElem::func()); + global.define("strong", StrongElem::func()); + global.define("emph", EmphElem::func()); + global.define("lower", lower); + global.define("upper", upper); + global.define("smallcaps", smallcaps); + global.define("sub", SubElem::func()); + global.define("super", SuperElem::func()); + global.define("underline", UnderlineElem::func()); + global.define("strike", StrikeElem::func()); + global.define("overline", OverlineElem::func()); + global.define("raw", RawElem::func()); + global.define("lorem", lorem); +} + /// Customize the look and layout of text in a variety of ways. /// /// This function is used often, both with set rules and directly. While the set |
