Number equation environments in route-D
This commit is contained in:
1 parent
3cbfdabe03
commit
bb897411d0
5 files changed
+207
-6
No files matched your search
@@ -671,6 +671,26 @@ impl Page {
|
||||
cursor += width;
|
||||
}
|
||||
}
|
||||
MathAtom::Tagged { body, tag } => {
|
||||
let body_box = math::layout_math(body, font);
|
||||
Self::paint_math(body, font, x, baseline, size, list);
|
||||
let tag_width: i64 = tag
|
||||
.chars()
|
||||
.map(|character| Cmr10Metrics::Roman.width(character))
|
||||
.sum();
|
||||
let mut pen = x + body_box.width.max(tag_width) - tag_width;
|
||||
for character in tag.chars() {
|
||||
let width = Cmr10Metrics::Roman.width(character);
|
||||
list.push(DisplayItem::Text {
|
||||
font: FontFace::Roman,
|
||||
x: pen,
|
||||
y: baseline,
|
||||
size,
|
||||
text: character.to_string(),
|
||||
});
|
||||
pen += width;
|
||||
}
|
||||
}
|
||||
MathAtom::Script { base, sub, sup } => {
|
||||
let base_box = math::layout_math(base, font);
|
||||
Self::paint_math(base, font, x, baseline, size, list);
|
||||
|
||||
Reference in new issue
Block a user