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) } } diff --git a/tests/ref/math/accent.png b/tests/ref/math/accent.png index 78d5f498..e3ad7f4d 100644 Binary files a/tests/ref/math/accent.png and b/tests/ref/math/accent.png differ diff --git a/tests/ref/math/attach-p3.png b/tests/ref/math/attach-p3.png index 104534b7..03c5da09 100644 Binary files a/tests/ref/math/attach-p3.png and b/tests/ref/math/attach-p3.png differ diff --git a/tests/ref/math/cases.png b/tests/ref/math/cases.png index b9e54e75..d54246cd 100644 Binary files a/tests/ref/math/cases.png and b/tests/ref/math/cases.png differ diff --git a/tests/ref/math/content.png b/tests/ref/math/content.png index 4fbd4670..e7ec48fe 100644 Binary files a/tests/ref/math/content.png and b/tests/ref/math/content.png differ diff --git a/tests/ref/math/frac.png b/tests/ref/math/frac.png index 0b81e37b..59357cff 100644 Binary files a/tests/ref/math/frac.png and b/tests/ref/math/frac.png differ diff --git a/tests/ref/math/matrix-alignment.png b/tests/ref/math/matrix-alignment.png index c3059cfd..546f8757 100644 Binary files a/tests/ref/math/matrix-alignment.png and b/tests/ref/math/matrix-alignment.png differ diff --git a/tests/ref/math/multiline.png b/tests/ref/math/multiline.png index bfa85b7b..e0b13f15 100644 Binary files a/tests/ref/math/multiline.png and b/tests/ref/math/multiline.png differ diff --git a/tests/ref/math/spacing.png b/tests/ref/math/spacing.png index 10adc724..31768239 100644 Binary files a/tests/ref/math/spacing.png and b/tests/ref/math/spacing.png differ diff --git a/tests/ref/math/style.png b/tests/ref/math/style.png index 27f0a27d..d2e6776a 100644 Binary files a/tests/ref/math/style.png and b/tests/ref/math/style.png differ diff --git a/tests/ref/math/syntax.png b/tests/ref/math/syntax.png index d828a478..c156353c 100644 Binary files a/tests/ref/math/syntax.png and b/tests/ref/math/syntax.png differ diff --git a/tests/ref/math/underover.png b/tests/ref/math/underover.png index 62dcfefc..c3bb47f9 100644 Binary files a/tests/ref/math/underover.png and b/tests/ref/math/underover.png differ