Keep body text clear of the title footnote area

This commit is contained in:
gloamxun committed 2026-10-19 18:51:25 +08:00
1 parent 247893282b
commit 8c07d3442e
2 files changed
+8 -3

No files matched your search

+7 -2
View File
@@ -1705,6 +1705,7 @@ pub(super) fn build_positioned_pages(
// inside the page frame; TeX's \maxdepth plays the same role.
let mut page_goal = scaled_points(content_height_mm * PDF_POINTS_PER_INCH / 25.4).0 as i64
- millimeters_to_scaled(3.0);
let footnote_goal = page_goal;
let mut pages = vec![PositionedPage::default()];
set_body_line_factor(if model.title_style == TitleStyle::Preprint {
1.1
@@ -1726,7 +1727,11 @@ pub(super) fn build_positioned_pages(
math_layout,
cache,
);
page_goal = page_goal.saturating_sub(title_reserve);
// The measured note may wrap to one more line than the conservative
// estimate; reserve a full baseline of slack above the insertion area.
if title_reserve > 0 {
page_goal = page_goal.saturating_sub(title_reserve.saturating_add(normal_line_height));
}
let mut deferred: Vec<DeferredFloat> = Vec::new();
let mut block_end_pages: HashMap<usize, usize> = HashMap::new();
let mut block_start_pages: HashMap<usize, usize> = HashMap::new();
@@ -3091,7 +3096,7 @@ pub(super) fn build_positioned_pages(
model,
&mut pages,
&block_end_pages,
page_goal,
footnote_goal,
content_width_mm,
metrics,
font_cache,