mirror of
https://github.com/typst/typst
synced 2025-05-14 04:56:26 +08:00
Error message when font doesn't support math
This commit is contained in:
parent
c7c135f25e
commit
33013af37a
@ -198,6 +198,9 @@ impl Layout for FormulaNode {
|
|||||||
Some(font)
|
Some(font)
|
||||||
})
|
})
|
||||||
else {
|
else {
|
||||||
|
if let Some(span) = self.body.span() {
|
||||||
|
bail!(span, "current font does not support math");
|
||||||
|
}
|
||||||
return Ok(Fragment::frame(Frame::new(Size::zero())))
|
return Ok(Fragment::frame(Frame::new(Size::zero())))
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -553,7 +553,8 @@ impl Eval for ast::Math {
|
|||||||
self.exprs()
|
self.exprs()
|
||||||
.map(|expr| Ok(expr.eval(vm)?.display_in_math()))
|
.map(|expr| Ok(expr.eval(vm)?.display_in_math()))
|
||||||
.collect::<SourceResult<_>>()?,
|
.collect::<SourceResult<_>>()?,
|
||||||
))
|
)
|
||||||
|
.spanned(self.span()))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user