summaryrefslogtreecommitdiff
path: root/library/src/math/mod.rs
diff options
context:
space:
mode:
Diffstat (limited to 'library/src/math/mod.rs')
-rw-r--r--library/src/math/mod.rs22
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,