diff options
| author | Malo <57839069+MDLC01@users.noreply.github.com> | 2025-01-31 11:05:03 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-01-31 10:05:03 +0000 |
| commit | f239b0a6a1e68a016cacf19eeef2df52e4affeb9 (patch) | |
| tree | 101b8aeba40b8c9925d273894cfc27de2a4b5756 /crates/typst-layout | |
| parent | 46727878da083eb8186373434997f5f7403cbb66 (diff) | |
Change the default math class of U+22A5 ⊥ UP TACK to Normal (#5714)
Diffstat (limited to 'crates/typst-layout')
| -rw-r--r-- | crates/typst-layout/src/math/fragment.rs | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/crates/typst-layout/src/math/fragment.rs b/crates/typst-layout/src/math/fragment.rs index 81b726ba..1b508a34 100644 --- a/crates/typst-layout/src/math/fragment.rs +++ b/crates/typst-layout/src/math/fragment.rs @@ -13,6 +13,7 @@ use typst_library::math::{EquationElem, MathSize}; use typst_library::text::{Font, Glyph, Lang, Region, TextElem, TextItem}; use typst_library::visualize::Paint; use typst_syntax::Span; +use typst_utils::default_math_class; use unicode_math_class::MathClass; use super::{stretch_glyph, MathContext, Scaled}; @@ -275,11 +276,7 @@ impl GlyphFragment { span: Span, ) -> Self { let class = EquationElem::class_in(styles) - .or_else(|| match c { - ':' => Some(MathClass::Relation), - '.' | '/' | '⋯' | '⋱' | '⋰' | '⋮' => Some(MathClass::Normal), - _ => unicode_math_class::class(c), - }) + .or_else(|| default_math_class(c)) .unwrap_or(MathClass::Normal); let mut fragment = Self { @@ -629,7 +626,7 @@ pub enum Limits { impl Limits { /// The default limit configuration if the given character is the base. pub fn for_char(c: char) -> Self { - match unicode_math_class::class(c) { + match default_math_class(c) { Some(MathClass::Large) => { if is_integral_char(c) { Limits::Never |
