Error message when font doesn't support math

This commit is contained in:
Laurenz 2023-01-27 19:27:32 +01:00
parent c7c135f25e
commit 33013af37a
2 changed files with 5 additions and 1 deletions

View File

@ -198,6 +198,9 @@ impl Layout for FormulaNode {
Some(font)
})
else {
if let Some(span) = self.body.span() {
bail!(span, "current font does not support math");
}
return Ok(Fragment::frame(Frame::new(Size::zero())))
};

View File

@ -553,7 +553,8 @@ impl Eval for ast::Math {
self.exprs()
.map(|expr| Ok(expr.eval(vm)?.display_in_math()))
.collect::<SourceResult<_>>()?,
))
)
.spanned(self.span()))
}
}