diff options
| author | Laurenz <laurmaedje@gmail.com> | 2023-01-22 13:16:03 +0100 |
|---|---|---|
| committer | Laurenz <laurmaedje@gmail.com> | 2023-01-22 13:16:03 +0100 |
| commit | eabbbf7eae04a4a8044d83acde84d8634f095b50 (patch) | |
| tree | 74682b60a8fdff575233afb59356bfa4803749d2 /library | |
| parent | 85f95f75b749bb7c160ba92d9f6008031f02c882 (diff) | |
Name handling for New Computer Modern Math
Diffstat (limited to 'library')
| -rw-r--r-- | library/src/math/mod.rs | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/library/src/math/mod.rs b/library/src/math/mod.rs index ce70f1de..785e027a 100644 --- a/library/src/math/mod.rs +++ b/library/src/math/mod.rs @@ -102,24 +102,24 @@ impl MathNode { } impl Show for MathNode { - fn show(&self, _: &mut Vt, _: &Content, styles: StyleChain) -> SourceResult<Content> { - let mut map = StyleMap::new(); - map.set_family(FontFamily::new("NewComputerModernMath"), styles); - - let mut realized = self - .clone() - .pack() - .guarded(Guard::Base(NodeId::of::<Self>())) - .styled_with_map(map); - + fn show(&self, _: &mut Vt, _: &Content, _: StyleChain) -> SourceResult<Content> { + let mut realized = self.clone().pack().guarded(Guard::Base(NodeId::of::<Self>())); if self.block { realized = realized.aligned(Axes::with_x(Some(Align::Center.into()))) } - Ok(realized) } } +impl Finalize for MathNode { + fn finalize(&self, realized: Content) -> Content { + realized.styled( + TextNode::FAMILY, + FallbackList(vec![FontFamily::new("New Computer Modern Math")]), + ) + } +} + impl Layout for MathNode { fn layout( &self, |
