diff options
| author | Max <max@mkor.je> | 2025-06-03 14:08:18 +0000 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-06-03 14:08:18 +0000 |
| commit | dd95f7d59474800a83a4d397dd13e34de35d56be (patch) | |
| tree | cbdb7215ada833300cf07a2d138feba9e61173f2 /crates/typst-library/src/math | |
| parent | 1b399646c270d518af250db3afb7ba35992e8751 (diff) | |
Fix bottom accent positioning in math (#6187)
Diffstat (limited to 'crates/typst-library/src/math')
| -rw-r--r-- | crates/typst-library/src/math/accent.rs | 13 |
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. |
