summaryrefslogtreecommitdiff
path: root/library/src/math
diff options
context:
space:
mode:
authorLaurenz <laurmaedje@gmail.com>2022-12-02 13:17:07 +0100
committerLaurenz <laurmaedje@gmail.com>2022-12-02 13:21:36 +0100
commit5110a41de1ca2236739ace2d37a1af912bb029f1 (patch)
tree22cc223140052bd7ec10798f5ecbffaae7c934a8 /library/src/math
parent33ab1fdbdda4e95e48b767a3f7f8f66413b6de0e (diff)
Introduce virtual typesetter
Diffstat (limited to 'library/src/math')
-rw-r--r--library/src/math/mod.rs6
-rw-r--r--library/src/math/tex.rs3
2 files changed, 5 insertions, 4 deletions
diff --git a/library/src/math/mod.rs b/library/src/math/mod.rs
index 7136c8b9..9d25d485 100644
--- a/library/src/math/mod.rs
+++ b/library/src/math/mod.rs
@@ -30,7 +30,7 @@ impl MathNode {
}
impl Show for MathNode {
- fn show(&self, _: Tracked<dyn World>, styles: StyleChain) -> Content {
+ fn show(&self, _: &mut Vt, _: &Content, styles: StyleChain) -> Content {
let mut map = StyleMap::new();
map.set_family(FontFamily::new("NewComputerModernMath"), styles);
@@ -51,11 +51,11 @@ impl Show for MathNode {
impl Layout for MathNode {
fn layout(
&self,
- world: Tracked<dyn World>,
+ vt: &mut Vt,
styles: StyleChain,
_: &Regions,
) -> SourceResult<Fragment> {
- layout_tex(world, &self.texify(), self.display, styles)
+ layout_tex(vt, &self.texify(), self.display, styles)
}
}
diff --git a/library/src/math/tex.rs b/library/src/math/tex.rs
index 5f332f3c..b2b6486e 100644
--- a/library/src/math/tex.rs
+++ b/library/src/math/tex.rs
@@ -35,13 +35,14 @@ impl Texify for Content {
/// Layout a TeX formula into a frame.
pub fn layout_tex(
- world: Tracked<dyn World>,
+ vt: &Vt,
tex: &str,
display: bool,
styles: StyleChain,
) -> SourceResult<Fragment> {
// Load the font.
let variant = variant(styles);
+ let world = vt.world();
let mut font = None;
for family in families(styles) {
font = world.book().select(family, variant).and_then(|id| world.font(id));