Map math alphabets onto Computer Modern Type1 faces
This commit is contained in:
1 parent
a95cf8092e
commit
a07d93510f
5 files changed
+142
-4
No files matched your search
@@ -682,6 +682,31 @@ impl Page {
|
||||
cursor += font.width(character);
|
||||
}
|
||||
}
|
||||
MathAtom::Alphabet { text, alphabet } => {
|
||||
let metrics = math::alphabet_metrics(*font, *alphabet);
|
||||
let face = match alphabet {
|
||||
math::MathAlphabet::Roman => FontFace::Roman,
|
||||
math::MathAlphabet::Bold => FontFace::Bold,
|
||||
math::MathAlphabet::Italic => FontFace::MathItalic,
|
||||
math::MathAlphabet::Sans => FontFace::Sans,
|
||||
math::MathAlphabet::Mono => FontFace::Mono,
|
||||
};
|
||||
let mut cursor = x;
|
||||
for character in text.chars() {
|
||||
list.push(DisplayItem::Text {
|
||||
font: face,
|
||||
x: cursor,
|
||||
y: baseline,
|
||||
size,
|
||||
text: character.to_string(),
|
||||
});
|
||||
cursor += if character == ' ' {
|
||||
metrics.space()
|
||||
} else {
|
||||
metrics.width(character)
|
||||
};
|
||||
}
|
||||
}
|
||||
MathAtom::Row(atoms) => {
|
||||
let mut cursor = x;
|
||||
for child in atoms {
|
||||
|
||||
Reference in new issue
Block a user