diff options
Diffstat (limited to 'crates')
| -rw-r--r-- | crates/typst-library/src/math/ctx.rs | 4 | ||||
| -rw-r--r-- | crates/typst/src/font/mod.rs | 2 |
2 files changed, 4 insertions, 2 deletions
diff --git a/crates/typst-library/src/math/ctx.rs b/crates/typst-library/src/math/ctx.rs index acd60e48..2ebd55b9 100644 --- a/crates/typst-library/src/math/ctx.rs +++ b/crates/typst-library/src/math/ctx.rs @@ -258,7 +258,9 @@ impl<'a, 'b, 'v> MathContext<'a, 'b, 'v> { self.local.set(TextElem::set_weight(if style.bold { FontWeight::BOLD } else { - FontWeight::REGULAR + // The normal weight is what we started with. + // It's 400 for CM Regular, 450 for CM Book. + self.font.info().variant.weight })); self.style = style; } diff --git a/crates/typst/src/font/mod.rs b/crates/typst/src/font/mod.rs index 2353e51c..888960f1 100644 --- a/crates/typst/src/font/mod.rs +++ b/crates/typst/src/font/mod.rs @@ -134,7 +134,7 @@ impl Hash for Font { impl Debug for Font { fn fmt(&self, f: &mut Formatter) -> fmt::Result { - write!(f, "Font({})", self.info().family) + write!(f, "Font({},{:?})", self.info().family, self.info().variant) } } |
