Draw big operators with cmex10 outlines

This commit is contained in:
gloamxun committed 2026-10-24 03:46:50 +08:00
1 parent 6446de6b6b
commit 66ceabad0e
7 files changed
+167 -28

No files matched your search

+15 -3
View File
@@ -23,6 +23,8 @@ pub enum FontFace {
MathItalic,
/// Computer Modern math symbols (`cmsy10`), addressed by TeX slot.
MathSymbol,
/// Computer Modern math extensions (`cmex10`), addressed by TeX slot.
MathExtension,
}
#[derive(Clone, Debug, PartialEq, Eq)]
@@ -1069,14 +1071,24 @@ impl Page {
});
}
MathAtom::BigOperator { name } => {
for (index, character) in name.chars().enumerate() {
if let Some(character) = math::big_operator_character(name) {
list.push(DisplayItem::Text {
font: FontFace::Roman,
x: x + index as i64 * font.width(character),
font: FontFace::MathExtension,
x,
y: baseline,
size,
text: character.to_string(),
});
} else {
for (index, character) in name.chars().enumerate() {
list.push(DisplayItem::Text {
font: FontFace::Roman,
x: x + index as i64 * font.width(character),
y: baseline,
size,
text: character.to_string(),
});
}
}
}
MathAtom::SizedDelimiter { delimiter, .. } => {