Fix large operators in cambria math (#3115)

This commit is contained in:
Wenzhuo Liu 2024-01-06 03:30:45 +08:00 committed by GitHub
parent 8fa573a9a2
commit 46053b62e5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 1 deletions

View File

@ -1,3 +1,5 @@
use std::f64::consts::SQRT_2;
use comemo::Prehashed;
use ecow::EcoString;
use rustybuzz::Feature;
@ -207,7 +209,8 @@ impl<'a, 'b, 'v> MathContext<'a, 'b, 'v> {
let class = self.style.class.as_custom().or(glyph.class);
if class == Some(MathClass::Large) {
let mut variant = if self.style.size == MathSize::Display {
let height = scaled!(self, display_operator_min_height);
let height = scaled!(self, display_operator_min_height)
.max(SQRT_2 * glyph.height());
glyph.stretch_vertical(self, height, Abs::zero())
} else {
glyph.into_variant()

Binary file not shown.

Before

Width:  |  Height:  |  Size: 6.3 KiB

After

Width:  |  Height:  |  Size: 6.3 KiB