summaryrefslogtreecommitdiff
path: root/library/src/math/ctx.rs
diff options
context:
space:
mode:
Diffstat (limited to 'library/src/math/ctx.rs')
-rw-r--r--library/src/math/ctx.rs5
1 files changed, 5 insertions, 0 deletions
diff --git a/library/src/math/ctx.rs b/library/src/math/ctx.rs
index bad0fe5a..1a51a8f4 100644
--- a/library/src/math/ctx.rs
+++ b/library/src/math/ctx.rs
@@ -1,5 +1,6 @@
use ttf_parser::math::MathValue;
use typst::font::{FontStyle, FontWeight};
+use typst::model::realize;
use unicode_segmentation::UnicodeSegmentation;
use super::*;
@@ -173,6 +174,10 @@ impl<'a, 'b, 'v> MathContext<'a, 'b, 'v> {
self.outer.chain(&self.local)
}
+ pub fn realize(&mut self, content: &Content) -> SourceResult<Option<Content>> {
+ realize(self.vt, content, self.outer.chain(&self.local))
+ }
+
pub fn style(&mut self, style: MathStyle) {
self.style_stack.push((self.style, self.size));
let base_size = TextElem::size_in(self.styles()) / self.style.size.factor(self);