Fix PDF rule placement, lipsum text, 10pt default, and page decorations

This commit is contained in:
gloamxun committed 2026-10-19 15:02:16 +08:00
1 parent e7bcdf6c53
commit 8d5cbc69ba
10 files changed
+372 -37

No files matched your search

+7 -7
View File
@@ -437,7 +437,7 @@ Serif text.
assert!(svg.contains(">Sans</text>"), "sans text missing");
assert!(svg.contains("extsf"), "textsf text missing");
assert!(
svg.contains("font-family=\"TexrraSans\" font-size=\"3.8806\" font-weight=\"700\""),
svg.contains("font-family=\"TexrraSans\" font-size=\"3.5278\" font-weight=\"700\""),
"bold sans face missing"
);
}
@@ -459,11 +459,11 @@ fn small_caps_uses_reduced_uppercase_glyphs() {
);
assert!(!svg.contains("mall"), "small caps leaked lowercase glyphs");
assert!(
svg.contains("font-size=\"3.1750\""),
svg.contains("font-size=\"2.8222\""),
"small caps were not reduced to 80%"
);
assert!(
svg.contains("font-size=\"3.8806\""),
svg.contains("font-size=\"3.5278\""),
"full-size capitals should remain full-size"
);
}
@@ -578,7 +578,7 @@ This is a minipage with enough text to wrap across several lines and demonstrate
"wrapped minipage tail missing"
);
let first = text_y(&svg, "This");
let wrapped = text_y(&svg, "text");
let wrapped = text_y(&svg, "block-wide.");
assert!(
wrapped > first + 3.0,
"minipage did not wrap: {first} -> {wrapped}"
@@ -677,11 +677,11 @@ Body text.
"right header is not at the right edge"
);
assert!(
text_y(&svg, "Left") < 15.0,
text_y(&svg, "Left") < 25.0,
"header is not near the top of the page"
);
assert!(
text_y(&svg, "Foot") > 275.0,
text_y(&svg, "Foot") > 250.0,
"footer is not near the bottom of the page"
);
}
@@ -731,7 +731,7 @@ fn default_plain_style_prints_a_page_number() {
assert_eq!(value["status"], "ok", "{}", value["message"]);
let svg = page_svg(&value, 0);
assert!(
text_y(&svg, "1") > 275.0,
text_y(&svg, "1") > 250.0,
"default page number is not in the footer"
);
}