Select real Computer Modern small caps

Add the cmcsc10 face for \scshape and \textsc, including its Type1 outline, and compose the sc shape with the surrounding family and series. Bold small caps substitute cmbx10 and a later shape command wins, matching NFSS.
This commit is contained in:
gloamxun committed 2026-10-24 12:52:15 +08:00
1 parent 9140990a7d
commit e303f7852f
11 files changed
+150 -13

No files matched your search

+23
View File
@@ -6260,6 +6260,29 @@ mod tests {
assert!(svg.contains("font-weight=\"bold\""));
}
#[test]
fn small_caps_paragraph_paints_with_the_small_caps_face() {
let unit = Unit::paragraph_with_face(1, "small caps", ParagraphFont::SmallCaps);
let page = Page {
items: unit.items,
insertions: Vec::new(),
marks: Vec::new(),
floats: Vec::new(),
sources: Vec::new(),
hash: 0,
};
let list = page.display_list();
assert!(list.items.iter().any(|item| matches!(
item,
crate::render::DisplayItem::Text {
font: crate::render::FontFace::SmallCaps,
..
}
)));
let svg = list.to_svg();
assert!(svg.contains("font-family=\"serif\""));
}
#[test]
fn mono_paragraph_paints_with_a_mono_face() {
let unit = Unit::paragraph_with_face(1, "code 123", ParagraphFont::Mono);