diff options
Diffstat (limited to 'src/library/math')
| -rw-r--r-- | src/library/math/rex.rs | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/library/math/rex.rs b/src/library/math/rex.rs index addf56b6..0268fb9c 100644 --- a/src/library/math/rex.rs +++ b/src/library/math/rex.rs @@ -35,13 +35,13 @@ impl Layout for RexNode { .at(span)?; // Prepare the font. - let data = ctx.fonts.get(face_id).buffer(); - let font = MathFont::parse(data) - .map_err(|_| "failed to parse math font") + let face = ctx.fonts.get(face_id); + let ctx = face + .math() + .and_then(FontContext::new) + .ok_or("font is not suitable for math") .at(span)?; - let ctx = FontContext::new(&font).ok_or("failed to parse math font").at(span)?; - // Layout the formula. let em = styles.get(TextNode::SIZE); let style = if self.display { Style::Display } else { Style::Text }; |
