Add per-face PDF font resources
This commit is contained in:
1 parent
03025de783
commit
d40595c7e5
5 files changed
+91
-9
No files matched your search
@@ -1598,6 +1598,23 @@ mod tests {
|
||||
assert!(text.contains("Tj"));
|
||||
assert!(text.trim_end().ends_with("%%EOF"));
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn pdf_writer_uses_a_bold_font_resource() {
|
||||
let mut list = crate::render::DisplayList::default();
|
||||
list.push(crate::render::DisplayItem::Text {
|
||||
x: 10,
|
||||
y: 20,
|
||||
size: 10 * 65_536,
|
||||
text: "bold".to_owned(),
|
||||
font: crate::render::FontFace::Bold,
|
||||
});
|
||||
let pdf = crate::pdf::display_list_to_pdf(&list, 400 * 65_536);
|
||||
let text = String::from_utf8_lossy(&pdf);
|
||||
assert!(text.contains("/BaseFont /Times-Bold"));
|
||||
assert!(text.contains("/F2 4 0 R"));
|
||||
assert!(text.contains("BT /F2"));
|
||||
}
|
||||
#[test]
|
||||
fn math_display_list_paints_symbols_and_fraction_rule() {
|
||||
let atom = crate::math::parse_math("x + \\frac{a}{b}");
|
||||
|
||||
Reference in new issue
Block a user