mirror of
https://github.com/typst/typst
synced 2025-05-13 20:46:23 +08:00
Fix font switch in math
This commit is contained in:
parent
9e918d06ad
commit
93138e2d4b
@ -252,6 +252,12 @@ impl LayoutMath for Content {
|
||||
}
|
||||
|
||||
if let Some(styled) = self.to::<StyledNode>() {
|
||||
if styled.map.contains(TextNode::FAMILY) {
|
||||
let frame = ctx.layout_content(self)?;
|
||||
ctx.push(FrameFragment::new(ctx, frame).with_spaced(true));
|
||||
return Ok(());
|
||||
}
|
||||
|
||||
let prev_map = std::mem::replace(&mut ctx.map, styled.map.clone());
|
||||
let prev_size = ctx.size;
|
||||
ctx.map.apply(prev_map.clone());
|
||||
|
Binary file not shown.
Before Width: | Height: | Size: 5.2 KiB After Width: | Height: | Size: 6.6 KiB |
@ -12,3 +12,8 @@ $ x := #table(columns: 2)[x][y]/mat(1, 2, 3) $
|
||||
---
|
||||
// Test non-formula math directly in content.
|
||||
#math.attach($a$, top: [b])
|
||||
|
||||
---
|
||||
// Test font switch.
|
||||
#let here = text.with("Noto Sans")
|
||||
$#here[f] := #here[Hi there]$.
|
||||
|
Loading…
x
Reference in New Issue
Block a user