summaryrefslogtreecommitdiff
path: root/crates/typst-library
diff options
context:
space:
mode:
Diffstat (limited to 'crates/typst-library')
-rw-r--r--crates/typst-library/src/math/accent.rs13
1 files changed, 13 insertions, 0 deletions
diff --git a/crates/typst-library/src/math/accent.rs b/crates/typst-library/src/math/accent.rs
index e62b6387..f2c9168c 100644
--- a/crates/typst-library/src/math/accent.rs
+++ b/crates/typst-library/src/math/accent.rs
@@ -80,6 +80,19 @@ impl Accent {
pub fn new(c: char) -> Self {
Self(Self::combine(c).unwrap_or(c))
}
+
+ /// List of bottom accents. Currently just a list of ones included in the
+ /// Unicode math class document.
+ const BOTTOM: &[char] = &[
+ '\u{0323}', '\u{032C}', '\u{032D}', '\u{032E}', '\u{032F}', '\u{0330}',
+ '\u{0331}', '\u{0332}', '\u{0333}', '\u{033A}', '\u{20E8}', '\u{20EC}',
+ '\u{20ED}', '\u{20EE}', '\u{20EF}',
+ ];
+
+ /// Whether this accent is a bottom accent or not.
+ pub fn is_bottom(&self) -> bool {
+ Self::BOTTOM.contains(&self.0)
+ }
}
/// This macro generates accent-related functions.