diff options
| author | damaxwell <damaxwell@alaska.edu> | 2023-08-02 14:34:54 -0800 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2023-08-03 00:34:54 +0200 |
| commit | 20eb284318dda2a854c0f818ff05930ad47d5cec (patch) | |
| tree | e799e41efaec15a7bd45df734e8a3830107ffc53 /crates | |
| parent | 733c5c9913e0550d6c009eea639e4a7b77b88c1b (diff) | |
Ensure normal weight math font face is consistent (#1774)
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) } } |
