summaryrefslogtreecommitdiff
path: root/library/src/math/mod.rs
diff options
context:
space:
mode:
authorLaurenz <laurmaedje@gmail.com>2023-03-08 10:43:03 +0100
committerLaurenz <laurmaedje@gmail.com>2023-03-08 10:44:24 +0100
commit1b2b53ecb91a9bd7fb3493e471ae03cd142a7c03 (patch)
tree682124c2343db9491c84bddbdca026c676f220c6 /library/src/math/mod.rs
parent25b5bd117529cd04bb789e1988eb3a3db8025a0e (diff)
Require font to be a named argument
Diffstat (limited to 'library/src/math/mod.rs')
-rw-r--r--library/src/math/mod.rs11
1 files changed, 5 insertions, 6 deletions
diff --git a/library/src/math/mod.rs b/library/src/math/mod.rs
index 9da12e4f..d719cb1a 100644
--- a/library/src/math/mod.rs
+++ b/library/src/math/mod.rs
@@ -41,8 +41,7 @@ use self::spacing::*;
use crate::layout::{HNode, ParNode, Spacing};
use crate::prelude::*;
use crate::text::{
- families, variant, FallbackList, FontFamily, LinebreakNode, SpaceNode, TextNode,
- TextSize,
+ families, variant, FontFamily, FontList, LinebreakNode, SpaceNode, TextNode, TextSize,
};
/// Create a module with all math definitions.
@@ -113,7 +112,7 @@ pub fn module() -> Module {
///
/// ## Example
/// ```example
-/// #set text("New Computer Modern")
+/// #set text(font: "New Computer Modern")
///
/// Let $a$, $b$, and $c$ be the side
/// lengths of right-angled triangle.
@@ -161,8 +160,8 @@ impl Finalize for FormulaNode {
realized
.styled(TextNode::WEIGHT, FontWeight::from_number(450))
.styled(
- TextNode::FAMILY,
- FallbackList(vec![FontFamily::new("New Computer Modern Math")]),
+ TextNode::FONT,
+ FontList(vec![FontFamily::new("New Computer Modern Math")]),
)
}
}
@@ -233,7 +232,7 @@ impl LayoutMath for Content {
if let Some(styled) = self.to::<StyledNode>() {
let map = styled.map();
- if map.contains(TextNode::FAMILY) {
+ if map.contains(TextNode::FONT) {
let frame = ctx.layout_content(self)?;
ctx.push(FrameFragment::new(ctx, frame).with_spaced(true));
return Ok(());